From 09b844bd6a6d707088eb0603548d62458831381d Mon Sep 17 00:00:00 2001 From: Jake Arkinstall <65358059+jake-arkinstall@users.noreply.github.com> Date: Thu, 11 Jun 2026 17:58:25 +0100 Subject: [PATCH 1/6] jake's initial argreader support (duplicated and squashed) from PR #1682 Initial concept of entrypoint arg lowering using selene's argreader utility Restore debug path stripping, but just strip the paths to keep the IR valid cargo fmt Anyhow is now not behind a feature flag Add simple documentation to satisfy clippy (will likely need elaboration) --- qis-compiler/pyproject.toml | 2 + qis-compiler/python/tests/generate_hugrs.py | 7 +- .../python/tests/resources/entry_args.hugr | Bin 1898 -> 2940 bytes ...scard_qb_array_aarch64-apple-darwin_helios | 60 +- .../entry_args_aarch64-apple-darwin_helios | 408 +++++++++++++ .../flip_some_aarch64-apple-darwin_helios | 24 +- ...asure_qb_array_aarch64-apple-darwin_helios | 216 +++---- .../no_results_aarch64-apple-darwin_helios | 6 +- ...ostselect_exit_aarch64-apple-darwin_helios | 10 +- ...stselect_panic_aarch64-apple-darwin_helios | 10 +- ...t_current_shot_aarch64-apple-darwin_helios | 4 +- .../rus_aarch64-apple-darwin_helios | 26 +- ...iscard_qb_array_x86_64-apple-darwin_helios | 22 +- .../entry_args_x86_64-apple-darwin_helios | 408 +++++++++++++ .../flip_some_x86_64-apple-darwin_helios | 24 +- ...easure_qb_array_x86_64-apple-darwin_helios | 70 +-- .../no_results_x86_64-apple-darwin_helios | 6 +- ...postselect_exit_x86_64-apple-darwin_helios | 10 +- ...ostselect_panic_x86_64-apple-darwin_helios | 10 +- ...nt_current_shot_x86_64-apple-darwin_helios | 4 +- .../rus_x86_64-apple-darwin_helios | 26 +- ...d_qb_array_x86_64-unknown-linux-gnu_helios | 22 +- ...entry_args_x86_64-unknown-linux-gnu_helios | 408 +++++++++++++ .../flip_some_x86_64-unknown-linux-gnu_helios | 24 +- ...e_qb_array_x86_64-unknown-linux-gnu_helios | 70 +-- ...no_results_x86_64-unknown-linux-gnu_helios | 6 +- ...elect_exit_x86_64-unknown-linux-gnu_helios | 10 +- ...lect_panic_x86_64-unknown-linux-gnu_helios | 10 +- ...rrent_shot_x86_64-unknown-linux-gnu_helios | 4 +- .../rus_x86_64-unknown-linux-gnu_helios | 26 +- ...iscard_qb_array_x86_64-windows-msvc_helios | 22 +- .../entry_args_x86_64-windows-msvc_helios | 408 +++++++++++++ .../flip_some_x86_64-windows-msvc_helios | 24 +- ...easure_qb_array_x86_64-windows-msvc_helios | 70 +-- .../no_results_x86_64-windows-msvc_helios | 6 +- ...postselect_exit_x86_64-windows-msvc_helios | 10 +- ...ostselect_panic_x86_64-windows-msvc_helios | 10 +- ...nt_current_shot_x86_64-windows-msvc_helios | 4 +- .../rus_x86_64-windows-msvc_helios | 26 +- .../discard_qb_array_aarch64-apple-darwin_sol | 60 +- .../entry_args_aarch64-apple-darwin_sol | 408 +++++++++++++ .../flip_some_aarch64-apple-darwin_sol | 24 +- .../measure_qb_array_aarch64-apple-darwin_sol | 216 +++---- .../no_results_aarch64-apple-darwin_sol | 6 +- .../postselect_exit_aarch64-apple-darwin_sol | 10 +- .../postselect_panic_aarch64-apple-darwin_sol | 10 +- ...rint_current_shot_aarch64-apple-darwin_sol | 4 +- .../rus_aarch64-apple-darwin_sol | 26 +- .../discard_qb_array_x86_64-apple-darwin_sol | 22 +- .../entry_args_x86_64-apple-darwin_sol | 408 +++++++++++++ .../flip_some_x86_64-apple-darwin_sol | 24 +- .../measure_qb_array_x86_64-apple-darwin_sol | 70 +-- .../no_results_x86_64-apple-darwin_sol | 6 +- .../postselect_exit_x86_64-apple-darwin_sol | 10 +- .../postselect_panic_x86_64-apple-darwin_sol | 10 +- ...print_current_shot_x86_64-apple-darwin_sol | 4 +- .../rus_x86_64-apple-darwin_sol | 26 +- ...card_qb_array_x86_64-unknown-linux-gnu_sol | 22 +- .../entry_args_x86_64-unknown-linux-gnu_sol | 408 +++++++++++++ .../flip_some_x86_64-unknown-linux-gnu_sol | 24 +- ...sure_qb_array_x86_64-unknown-linux-gnu_sol | 70 +-- .../no_results_x86_64-unknown-linux-gnu_sol | 6 +- ...stselect_exit_x86_64-unknown-linux-gnu_sol | 10 +- ...tselect_panic_x86_64-unknown-linux-gnu_sol | 10 +- ..._current_shot_x86_64-unknown-linux-gnu_sol | 4 +- .../rus_x86_64-unknown-linux-gnu_sol | 26 +- .../discard_qb_array_x86_64-windows-msvc_sol | 22 +- .../entry_args_x86_64-windows-msvc_sol | 408 +++++++++++++ .../flip_some_x86_64-windows-msvc_sol | 24 +- .../measure_qb_array_x86_64-windows-msvc_sol | 70 +-- .../no_results_x86_64-windows-msvc_sol | 6 +- .../postselect_exit_x86_64-windows-msvc_sol | 10 +- .../postselect_panic_x86_64-windows-msvc_sol | 10 +- ...print_current_shot_x86_64-windows-msvc_sol | 4 +- .../rus_x86_64-windows-msvc_sol | 26 +- ...scard_qb_array_aarch64-apple-darwin_helios | 60 +- .../flip_some_aarch64-apple-darwin_helios | 24 +- ...asure_qb_array_aarch64-apple-darwin_helios | 216 +++---- .../no_results_aarch64-apple-darwin_helios | 6 +- ...ostselect_exit_aarch64-apple-darwin_helios | 10 +- ...stselect_panic_aarch64-apple-darwin_helios | 10 +- ...t_current_shot_aarch64-apple-darwin_helios | 4 +- .../qft_32_aarch64-apple-darwin_helios | 52 +- .../rus_aarch64-apple-darwin_helios | 26 +- ..._qb_array_aarch64-unknown-linux-gnu_helios | 60 +- ...flip_some_aarch64-unknown-linux-gnu_helios | 24 +- ..._qb_array_aarch64-unknown-linux-gnu_helios | 216 +++---- ...o_results_aarch64-unknown-linux-gnu_helios | 6 +- ...lect_exit_aarch64-unknown-linux-gnu_helios | 10 +- ...ect_panic_aarch64-unknown-linux-gnu_helios | 10 +- ...rent_shot_aarch64-unknown-linux-gnu_helios | 4 +- .../qft_32_aarch64-unknown-linux-gnu_helios | 52 +- .../rus_aarch64-unknown-linux-gnu_helios | 26 +- ...iscard_qb_array_x86_64-apple-darwin_helios | 22 +- .../flip_some_x86_64-apple-darwin_helios | 24 +- ...easure_qb_array_x86_64-apple-darwin_helios | 70 +-- .../no_results_x86_64-apple-darwin_helios | 6 +- ...postselect_exit_x86_64-apple-darwin_helios | 10 +- ...ostselect_panic_x86_64-apple-darwin_helios | 10 +- ...nt_current_shot_x86_64-apple-darwin_helios | 4 +- .../qft_32_x86_64-apple-darwin_helios | 52 +- .../rus_x86_64-apple-darwin_helios | 26 +- ...d_qb_array_x86_64-unknown-linux-gnu_helios | 22 +- .../flip_some_x86_64-unknown-linux-gnu_helios | 24 +- ...e_qb_array_x86_64-unknown-linux-gnu_helios | 70 +-- ...no_results_x86_64-unknown-linux-gnu_helios | 6 +- ...elect_exit_x86_64-unknown-linux-gnu_helios | 10 +- ...lect_panic_x86_64-unknown-linux-gnu_helios | 10 +- ...rrent_shot_x86_64-unknown-linux-gnu_helios | 4 +- .../qft_32_x86_64-unknown-linux-gnu_helios | 52 +- .../rus_x86_64-unknown-linux-gnu_helios | 26 +- ...iscard_qb_array_x86_64-windows-msvc_helios | 22 +- .../flip_some_x86_64-windows-msvc_helios | 24 +- ...easure_qb_array_x86_64-windows-msvc_helios | 70 +-- .../no_results_x86_64-windows-msvc_helios | 6 +- ...postselect_exit_x86_64-windows-msvc_helios | 10 +- ...ostselect_panic_x86_64-windows-msvc_helios | 10 +- ...nt_current_shot_x86_64-windows-msvc_helios | 4 +- .../qft_32_x86_64-windows-msvc_helios | 52 +- .../rus_x86_64-windows-msvc_helios | 26 +- .../discard_qb_array_aarch64-apple-darwin_sol | 60 +- .../flip_some_aarch64-apple-darwin_sol | 24 +- .../measure_qb_array_aarch64-apple-darwin_sol | 216 +++---- .../no_results_aarch64-apple-darwin_sol | 6 +- .../postselect_exit_aarch64-apple-darwin_sol | 10 +- .../postselect_panic_aarch64-apple-darwin_sol | 10 +- ...rint_current_shot_aarch64-apple-darwin_sol | 4 +- .../qft_32_aarch64-apple-darwin_sol | 52 +- .../rus_aarch64-apple-darwin_sol | 26 +- ...ard_qb_array_aarch64-unknown-linux-gnu_sol | 60 +- .../flip_some_aarch64-unknown-linux-gnu_sol | 24 +- ...ure_qb_array_aarch64-unknown-linux-gnu_sol | 216 +++---- .../no_results_aarch64-unknown-linux-gnu_sol | 6 +- ...tselect_exit_aarch64-unknown-linux-gnu_sol | 10 +- ...select_panic_aarch64-unknown-linux-gnu_sol | 10 +- ...current_shot_aarch64-unknown-linux-gnu_sol | 4 +- .../qft_32_aarch64-unknown-linux-gnu_sol | 52 +- .../rus_aarch64-unknown-linux-gnu_sol | 26 +- .../discard_qb_array_x86_64-apple-darwin_sol | 22 +- .../flip_some_x86_64-apple-darwin_sol | 24 +- .../measure_qb_array_x86_64-apple-darwin_sol | 70 +-- .../no_results_x86_64-apple-darwin_sol | 6 +- .../postselect_exit_x86_64-apple-darwin_sol | 10 +- .../postselect_panic_x86_64-apple-darwin_sol | 10 +- ...print_current_shot_x86_64-apple-darwin_sol | 4 +- .../qft_32_x86_64-apple-darwin_sol | 52 +- .../rus_x86_64-apple-darwin_sol | 26 +- ...card_qb_array_x86_64-unknown-linux-gnu_sol | 22 +- .../flip_some_x86_64-unknown-linux-gnu_sol | 24 +- ...sure_qb_array_x86_64-unknown-linux-gnu_sol | 70 +-- .../no_results_x86_64-unknown-linux-gnu_sol | 6 +- ...stselect_exit_x86_64-unknown-linux-gnu_sol | 10 +- ...tselect_panic_x86_64-unknown-linux-gnu_sol | 10 +- ..._current_shot_x86_64-unknown-linux-gnu_sol | 4 +- .../qft_32_x86_64-unknown-linux-gnu_sol | 52 +- .../rus_x86_64-unknown-linux-gnu_sol | 26 +- .../discard_qb_array_x86_64-windows-msvc_sol | 22 +- .../flip_some_x86_64-windows-msvc_sol | 24 +- .../measure_qb_array_x86_64-windows-msvc_sol | 70 +-- .../no_results_x86_64-windows-msvc_sol | 6 +- .../postselect_exit_x86_64-windows-msvc_sol | 10 +- .../postselect_panic_x86_64-windows-msvc_sol | 10 +- ...print_current_shot_x86_64-windows-msvc_sol | 4 +- .../qft_32_x86_64-windows-msvc_sol | 52 +- .../rus_x86_64-windows-msvc_sol | 26 +- qis-compiler/rust/lib.rs | 30 +- tket-qsystem/Cargo.toml | 6 +- tket-qsystem/src/extension.rs | 1 + tket-qsystem/src/extension/argreader.rs | 536 ++++++++++++++++++ tket-qsystem/src/llvm.rs | 1 + tket-qsystem/src/llvm/argreader.rs | 277 +++++++++ 171 files changed, 6468 insertions(+), 2376 deletions(-) create mode 100644 qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-entry_args/entry_args_aarch64-apple-darwin_helios create mode 100644 qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-entry_args/entry_args_x86_64-apple-darwin_helios create mode 100644 qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-entry_args/entry_args_x86_64-unknown-linux-gnu_helios create mode 100644 qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-entry_args/entry_args_x86_64-windows-msvc_helios create mode 100644 qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-entry_args/entry_args_aarch64-apple-darwin_sol create mode 100644 qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-entry_args/entry_args_x86_64-apple-darwin_sol create mode 100644 qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-entry_args/entry_args_x86_64-unknown-linux-gnu_sol create mode 100644 qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-entry_args/entry_args_x86_64-windows-msvc_sol create mode 100644 tket-qsystem/src/extension/argreader.rs create mode 100644 tket-qsystem/src/llvm/argreader.rs diff --git a/qis-compiler/pyproject.toml b/qis-compiler/pyproject.toml index 96e405389..afa99cb44 100644 --- a/qis-compiler/pyproject.toml +++ b/qis-compiler/pyproject.toml @@ -77,6 +77,8 @@ cache-keys = [ { file = "pyproject.toml" }, { file = "Cargo.toml" }, { file = "rust/**/*.rs" }, + { file = "../tket/**/*.rs" }, + { file = "../tket-qsystem/**/*.rs" }, ] [tool.cibuildwheel] diff --git a/qis-compiler/python/tests/generate_hugrs.py b/qis-compiler/python/tests/generate_hugrs.py index 4c21c96b2..019ebf517 100644 --- a/qis-compiler/python/tests/generate_hugrs.py +++ b/qis-compiler/python/tests/generate_hugrs.py @@ -242,8 +242,13 @@ def main() -> None: def entry_args() -> bytes: @guppy - def foo(a: int) -> None: + def foo(a: int, b: float, c: bool, d: array[int, 5], e: array[float, 3], f: array[bool, 8]) -> None: result("a", a) + result("b", b) + result("c", c) + result("d", d) + result("e", e) + result("f", f) return foo.compile_function().to_bytes() diff --git a/qis-compiler/python/tests/resources/entry_args.hugr b/qis-compiler/python/tests/resources/entry_args.hugr index a84115c38e25683e53915cfb0dc7981fa6f9bb82..9345f3356b57a44d83dba682f802159fd9c87033 100644 GIT binary patch literal 2940 zcmV-?3xo7XRYy{3NJ@4BK`6B^{Qy`^TL2oGWFJX4nE!nr4}UI?0j~QP&;E(p9vXzHO%>eawu$!Xjn|YHZN39B077a)b%dJ?Ufa zj~OLJ)Olw#6orx^$|Y{-mFb|O85V8d)6hNXBVnj(mM#sL5$K-ub&qJ%e>VioWeG#c zILFXcjs>93m>ITcCQ4ou*J_bsC~LKfn7!pqTE0!m<)jfvl zJ_8C!s{2rNC#vo)ln_+iQ>gAj)g4LQ+CyM5y9Y5dGc!ZLqq^f%&vCZ)30N}Pa~#h{ zSbun?$;IlqNVezKdx=%YdzrkadfsC}doJ_F9tyk&Oirtw)9ThfW94YiQ%^>lemwtq zpgpg7{!?8>n}9qAs$2U8tQzh4kjeo|Mw=X{6435MJTFqW_6}HJyBDb+j8NT;RQDs* z-GsWef52k)oJjS2gv#PXYK;%6TRR41^#)5q%xbdsUzB2bS4NOqzfu(m2POKBdW~YXX=tv=5CkH z1sI)>sT&&2@R_4K=t+vg=+W#-x|NvX_RGnce~y=@-L!_g|{ z?w@JY>07Y)09L#OKShHskD}#SPCNi6ex<~d7-6cf^8b}yM9O=l7g0cpKLNm-DDfm_ zAsRde7ks0<3X``d-(vLJ>0Pk+lJ4Dm817f3e9X%S@G(Ci^d$iOikgqv!T$c>R{*^S z^ejWZruL<;H~1B`hvDXZ$2*VTy6f)-eTA*-!aSkOborr#j$41sw9queR*7=Gb*f92 zW68CB&jXKTnbShY?S&c}*!JBXXQ__M6WVCheWl|yXGNR$B5WT@iY;`Uk&bDf*F>S0 z2QAvXZ=rkA_uUMncN#=@-ldz*-f5Rc(amJXaFX-@g}-ig1*rvdZn9l^o>?oc@f?GKr_%K8erg4x>Mhbw||#>mplYG-lR>sM{m;YZzD#R zJm8cV0Wf5AP8Yzvs@tDyF2;Aae~PwI`C8iy0In=4OUKe>!ILFR z5e;4CXu+1n~0eUT!M_2Cjmimh0Bl5<~Q=~GQJL$t&qnWnV&q&{hr?t1I)Uil8?x6yaWdvnco zk4zq8+wqnQJcY-c2;q*Xz#XYUB`BPY9TadpT5ur?cPsO$oBcC!v>%|#?4nh;B1Vn` z2@MT#L|hUi91)jpi1GfX$0|x{*1UE#Va6$Bm=g;CJDsxP$cuReW zQB`IZZSokE8KzB6qlDA&8a50Nphjg5piOS$hDUhAqcXp=iie^st;sx3EAxt0@md`M zRHQPiXpeXq z)ZtX-lrD8)sk>e$tIS@Ty434xl^LZ?-H^(B(#&q8GLM>h>o~QVicHfK22Bcvd1DtP zMeudWn0TV3h?1gBASDwc#Tpw}jScKn!*P)*tYuyx%1=uo~#eJvSV51w5)k&r3Ftl zA8=*ClTD#$e0uzB@HP7)EXBMCWm2dVO7%nL97EE)C@IRY0Apl0(q^+XX2DUBS)!qN zXE1qV8PuL}R5U4cOjRfv@Km!YlnRxy;L4Jvc$)Wz1y9z3s~79jqv#|{v2>Cb4RTwr zzGv#A^2{|HOPiriGnVSKE*hGbys?=RJuf;#mO3bHHe-9_glOxIB1{&Nrpzh!%#>(p z&S=ofgU-ar8M36^bLKSfxnpK#X0@_3vqW9j6kirRSyUv`)*Z!}taMqh1TDzh7RR>e z%0jaAqq)>`vzKWU^I<*X`LaX#4&_IlCpC#AsydYCa^6LcUVl3W=fiFE+vqF6`IA05 z>5+P|jh@r-G0hx-s;JRK=E#W1h=_wgJJKPp!s93)pfA30gtfyf8zGJL0P(f3XA`Vca3mw4VB-p>y;E{Y!-o zoDn9Y`i!trV0N6^?5Kn7W>8y3EU~-5z>YrlswTG=cNPBi!L@Z)x0C1Wq65j$dQ+na zWk3C3D*K723`X22_3U58YBg$LzWPG}ow7eelX=&pW^RRzl6Z5@qRCy!-_??T(=hcH zyrsm@UqFrE`DeE?WDu#k#QeROE53c&jsh;jCHphJ3Bm!enK1zp4><#q4-ua7Z5k?# z`&|%|Wz31(WED;QLi0vOF5h5_l!d-?!)+7}D#-a9;IX%WZqf`X7XZZqfWuyvY7{{L zTPgtWO}IG%zze$EaCf$LhSZA$U*7rpC6@aOhffBG7D!PLcr7nK69OBimWgZuE~*@v zC~F54DtJ^8(9o?j6_ZDavMRtv^AeX;r)9D zqBunph7sK^;y?+3_NzW#)JSoe`B?&?n~>I;_TP5|g4tqEp{261A2Ln)(&(nYT_gd5 zTQhR;;6_f@AvVOw=6r7-@v1t>=hZ|#t!~P71&F8S0ar2)`jyv{Z%y9EROpg14 z2g7Oa!(mT`!`_FR|4(w4u9%sSN z;M@uPJGPA;YoCL2r?0&W$QSt>7+jqD_5>ct3lTjLBb>YTqer5o=9}0&mC;|}+ylJm zvHX_r!nxc0=*4L7!@1Y|Hkvk^JI!y}WWc#+?>-;fu&IG_$9^Mx&Swr3pZ@NeNK8ZSE0t=mM<VlyaKgU-)>!`UkEyAHeuZ0Wh(564o*?EzbScU5J0_4qS2T4ZiJ<8Ox|%CLO$ z>Tchj{WCS{B%`4X`*#Wt;j@32@DU(T(7!);ci$>dMMgs#=w~KdJ)1>L>Z`+6lC{-q zV13;9A+v}@WWJln{ZxO+k_3RdzjUl?>`2WjdA_?ree-3N$W7i|$|BEpjU{_y2i)Hc z@u~%8eM90LC2@;-MD5$NORQYVqU(|+QeSdLsZ{bj>(b&*U5!3jV4H;0? zvts^k#-XhwQ}yf(@yb?`ZGoC4>T#zeZS|}w;~wk7#Z|^1tF+mR%-lf4Ua-2)h zq`&nkY|X$rIs>&;)o8C*H=V2s*FVDVJr*0cGN#FYE4%tLkPJ zCU?d=V{5{6!^$|rhE;|QE7D6RmCMzq?+!7vm2}AvT!9(y*h+f6bZ%77S`zk!s-C?) zFge3k&yr=%9$hk0SM{kbPYO)gN;*}~^1vFTVXJ3B7fXW})t$aF2ROd4)w8yeEDBpa zyIm@sR~VML6n8)us;kPSSb~+Y-Z{2lArawvs|o-1)v8mgLpeNA)bJ?>I=ZcdHmXq&|P6~-9ILOv&V=Gy8){afqM9(r;bFitdU!!+CCS-(dWZt+<{?<`K_`vHCZ@(anu?B=Lccr9ZVVA`9J$d z2Vp2IMu371G~UVh$Ox(nYA2_08Ebp1sB+1H((&n8$kR{|<1A3_YJ+HO+-S}owj>q3 z<53pbFRJHmgC-X#d}ye1+tcd-bL#}O6DaIiC0mAWb;jn<*eW)h{aL3@n5nEVt-;2E zz{wz_lF$5YG0LV7)f3PHuUEdX=uhN)68WhFe^2AN1c|s)78hja+$#d+gx5BM@RH79 z9xw_gSoN7czIe)!KMC9`gE;L$8K^bcAE)A?q-CmoOaZ78n76x8R)QuxdMxVS%?`0z z`ae8-#<-hDw5Wz?#AAGW>PW?}IZ~`KaA9q8!&O7v0n8y^?85Fs2pTy7T`|4v(uMR8 kuh_ek5UM_-iRsOWJeMx(cLtZoCbYs+CG@$!!C>d71~uBX.foo.1"(i64 %0, double %1, i1 %2, { ptr, ptr, i64 } %3, { ptr, ptr, i64 } %4, { ptr, ptr, i64 } %5) local_unnamed_addr !dbg !4 { +alloca_block: + %.fca.0.extract161 = extractvalue { ptr, ptr, i64 } %3, 0 + %.fca.1.extract163 = extractvalue { ptr, ptr, i64 } %3, 1 + %.fca.2.extract165 = extractvalue { ptr, ptr, i64 } %3, 2 + %.fca.0.extract155 = extractvalue { ptr, ptr, i64 } %4, 0 + %.fca.1.extract157 = extractvalue { ptr, ptr, i64 } %4, 1 + %.fca.2.extract159 = extractvalue { ptr, ptr, i64 } %4, 2 + %.fca.0.extract149 = extractvalue { ptr, ptr, i64 } %5, 0 + %.fca.1.extract151 = extractvalue { ptr, ptr, i64 } %5, 1 + %.fca.2.extract153 = extractvalue { ptr, ptr, i64 } %5, 2 + %6 = lshr i64 %.fca.2.extract153, 6, !dbg !16 + %7 = getelementptr i64, ptr %.fca.1.extract151, i64 %6, !dbg !16 + %8 = load i64, ptr %7, align 4, !dbg !16 + %9 = and i64 %.fca.2.extract153, 63, !dbg !16 + %10 = shl nsw i64 -1, %9, !dbg !16 + %11 = and i64 %8, %10, !dbg !16 + store i64 %11, ptr %7, align 4, !dbg !16 + %last_valid.i = add i64 %.fca.2.extract153, 7, !dbg !16 + %12 = lshr i64 %last_valid.i, 6, !dbg !16 + %13 = getelementptr inbounds nuw i64, ptr %.fca.1.extract151, i64 %12, !dbg !16 + %14 = load i64, ptr %13, align 4, !dbg !16 + %15 = and i64 %last_valid.i, 63, !dbg !16 + %16 = xor i64 %15, 63, !dbg !16 + %17 = lshr i64 -1, %16, !dbg !16 + %18 = and i64 %14, %17, !dbg !16 + store i64 %18, ptr %13, align 4, !dbg !16 + %reass.sub.i = sub nsw i64 %12, %6, !dbg !16 + %.not.i = icmp eq i64 %reass.sub.i, -1, !dbg !16 + br i1 %.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +19: ; preds = %mask_block_ok.i + %20 = add nuw i64 %.02.i, 1, !dbg !16 + %exitcond.not.i = icmp eq i64 %.02.i, %reass.sub.i, !dbg !16 + br i1 %exitcond.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +mask_block_ok.i: ; preds = %alloca_block, %19 + %.02.i = phi i64 [ %20, %19 ], [ 0, %alloca_block ], !dbg !18 + %gep.i = getelementptr i64, ptr %7, i64 %.02.i, !dbg !16 + %21 = load i64, ptr %gep.i, align 4, !dbg !16 + %22 = icmp eq i64 %21, 0, !dbg !16 + br i1 %22, label %19, label %mask_block_err.i, !dbg !16 + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !16 + unreachable, !dbg !16 + +__barray_check_none_borrowed.exit: ; preds = %19, %alloca_block + %23 = tail call ptr @heap_alloc(i64 8), !dbg !18 + %24 = tail call ptr @heap_alloc(i64 8), !dbg !18 + store i64 0, ptr %24, align 1, !dbg !18 + %25 = getelementptr inbounds i1, ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %26 = load i64, ptr %25, align 1, !dbg !18 + store i64 %26, ptr %23, align 1, !dbg !18 + %27 = load i64, ptr %7, align 4, !dbg !19 + %28 = and i64 %27, %10, !dbg !19 + store i64 %28, ptr %7, align 4, !dbg !19 + %29 = load i64, ptr %13, align 4, !dbg !19 + %30 = and i64 %29, %17, !dbg !19 + store i64 %30, ptr %13, align 4, !dbg !19 + br i1 %.not.i, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +31: ; preds = %mask_block_ok.i183 + %32 = add nuw i64 %.02.i184, 1, !dbg !19 + %exitcond.not.i187 = icmp eq i64 %.02.i184, %reass.sub.i, !dbg !19 + br i1 %exitcond.not.i187, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +mask_block_ok.i183: ; preds = %__barray_check_none_borrowed.exit, %31 + %.02.i184 = phi i64 [ %32, %31 ], [ 0, %__barray_check_none_borrowed.exit ], !dbg !18 + %gep.i185 = getelementptr i64, ptr %7, i64 %.02.i184, !dbg !19 + %33 = load i64, ptr %gep.i185, align 4, !dbg !19 + %34 = icmp eq i64 %33, 0, !dbg !19 + br i1 %34, label %31, label %mask_block_err.i186, !dbg !19 + +mask_block_err.i186: ; preds = %mask_block_ok.i183 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !19 + unreachable, !dbg !19 + +__barray_check_none_borrowed.exit188: ; preds = %31, %__barray_check_none_borrowed.exit + %35 = lshr i64 %.fca.2.extract159, 6, !dbg !21 + %36 = getelementptr i64, ptr %.fca.1.extract157, i64 %35, !dbg !21 + %37 = load i64, ptr %36, align 4, !dbg !21 + %38 = and i64 %.fca.2.extract159, 63, !dbg !21 + %39 = shl nsw i64 -1, %38, !dbg !21 + %40 = and i64 %37, %39, !dbg !21 + store i64 %40, ptr %36, align 4, !dbg !21 + %last_valid.i189 = add i64 %.fca.2.extract159, 2, !dbg !21 + %41 = lshr i64 %last_valid.i189, 6, !dbg !21 + %42 = getelementptr inbounds nuw i64, ptr %.fca.1.extract157, i64 %41, !dbg !21 + %43 = load i64, ptr %42, align 4, !dbg !21 + %44 = and i64 %last_valid.i189, 63, !dbg !21 + %45 = xor i64 %44, 63, !dbg !21 + %46 = lshr i64 -1, %45, !dbg !21 + %47 = and i64 %43, %46, !dbg !21 + store i64 %47, ptr %42, align 4, !dbg !21 + %reass.sub.i190 = sub nsw i64 %41, %35, !dbg !21 + %.not.i191 = icmp eq i64 %reass.sub.i190, -1, !dbg !21 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +48: ; preds = %mask_block_ok.i192 + %49 = add nuw i64 %.02.i193, 1, !dbg !21 + %exitcond.not.i196 = icmp eq i64 %.02.i193, %reass.sub.i190, !dbg !21 + br i1 %exitcond.not.i196, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +mask_block_ok.i192: ; preds = %__barray_check_none_borrowed.exit188, %48 + %.02.i193 = phi i64 [ %49, %48 ], [ 0, %__barray_check_none_borrowed.exit188 ], !dbg !23 + %gep.i194 = getelementptr i64, ptr %36, i64 %.02.i193, !dbg !21 + %50 = load i64, ptr %gep.i194, align 4, !dbg !21 + %51 = icmp eq i64 %50, 0, !dbg !21 + br i1 %51, label %48, label %mask_block_err.i195, !dbg !21 + +mask_block_err.i195: ; preds = %mask_block_ok.i192 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !21 + unreachable, !dbg !21 + +__barray_check_none_borrowed.exit197: ; preds = %48, %__barray_check_none_borrowed.exit188 + %52 = tail call ptr @heap_alloc(i64 24), !dbg !23 + %53 = tail call ptr @heap_alloc(i64 8), !dbg !23 + store i64 0, ptr %53, align 1, !dbg !23 + %54 = getelementptr inbounds double, ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(24) %52, ptr noundef nonnull align 1 dereferenceable(24) %54, i64 24, i1 false), !dbg !23 + %55 = load i64, ptr %36, align 4, !dbg !24 + %56 = and i64 %55, %39, !dbg !24 + store i64 %56, ptr %36, align 4, !dbg !24 + %57 = load i64, ptr %42, align 4, !dbg !24 + %58 = and i64 %57, %46, !dbg !24 + store i64 %58, ptr %42, align 4, !dbg !24 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +59: ; preds = %mask_block_ok.i201 + %60 = add nuw i64 %.02.i202, 1, !dbg !24 + %exitcond.not.i205 = icmp eq i64 %.02.i202, %reass.sub.i190, !dbg !24 + br i1 %exitcond.not.i205, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +mask_block_ok.i201: ; preds = %__barray_check_none_borrowed.exit197, %59 + %.02.i202 = phi i64 [ %60, %59 ], [ 0, %__barray_check_none_borrowed.exit197 ], !dbg !23 + %gep.i203 = getelementptr i64, ptr %36, i64 %.02.i202, !dbg !24 + %61 = load i64, ptr %gep.i203, align 4, !dbg !24 + %62 = icmp eq i64 %61, 0, !dbg !24 + br i1 %62, label %59, label %mask_block_err.i204, !dbg !24 + +mask_block_err.i204: ; preds = %mask_block_ok.i201 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !24 + unreachable, !dbg !24 + +__barray_check_none_borrowed.exit206: ; preds = %59, %__barray_check_none_borrowed.exit197 + %63 = lshr i64 %.fca.2.extract165, 6, !dbg !26 + %64 = getelementptr i64, ptr %.fca.1.extract163, i64 %63, !dbg !26 + %65 = load i64, ptr %64, align 4, !dbg !26 + %66 = and i64 %.fca.2.extract165, 63, !dbg !26 + %67 = shl nsw i64 -1, %66, !dbg !26 + %68 = and i64 %65, %67, !dbg !26 + store i64 %68, ptr %64, align 4, !dbg !26 + %last_valid.i207 = add i64 %.fca.2.extract165, 4, !dbg !26 + %69 = lshr i64 %last_valid.i207, 6, !dbg !26 + %70 = getelementptr inbounds nuw i64, ptr %.fca.1.extract163, i64 %69, !dbg !26 + %71 = load i64, ptr %70, align 4, !dbg !26 + %72 = and i64 %last_valid.i207, 63, !dbg !26 + %73 = xor i64 %72, 63, !dbg !26 + %74 = lshr i64 -1, %73, !dbg !26 + %75 = and i64 %71, %74, !dbg !26 + store i64 %75, ptr %70, align 4, !dbg !26 + %reass.sub.i208 = sub nsw i64 %69, %63, !dbg !26 + %.not.i209 = icmp eq i64 %reass.sub.i208, -1, !dbg !26 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +76: ; preds = %mask_block_ok.i210 + %77 = add nuw i64 %.02.i211, 1, !dbg !26 + %exitcond.not.i214 = icmp eq i64 %.02.i211, %reass.sub.i208, !dbg !26 + br i1 %exitcond.not.i214, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +mask_block_ok.i210: ; preds = %__barray_check_none_borrowed.exit206, %76 + %.02.i211 = phi i64 [ %77, %76 ], [ 0, %__barray_check_none_borrowed.exit206 ], !dbg !28 + %gep.i212 = getelementptr i64, ptr %64, i64 %.02.i211, !dbg !26 + %78 = load i64, ptr %gep.i212, align 4, !dbg !26 + %79 = icmp eq i64 %78, 0, !dbg !26 + br i1 %79, label %76, label %mask_block_err.i213, !dbg !26 + +mask_block_err.i213: ; preds = %mask_block_ok.i210 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !26 + unreachable, !dbg !26 + +__barray_check_none_borrowed.exit215: ; preds = %76, %__barray_check_none_borrowed.exit206 + %80 = tail call ptr @heap_alloc(i64 40), !dbg !28 + %81 = tail call ptr @heap_alloc(i64 8), !dbg !28 + store i64 0, ptr %81, align 1, !dbg !28 + %82 = getelementptr inbounds i64, ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(40) %80, ptr noundef nonnull align 1 dereferenceable(40) %82, i64 40, i1 false), !dbg !28 + %83 = load i64, ptr %64, align 4, !dbg !29 + %84 = and i64 %83, %67, !dbg !29 + store i64 %84, ptr %64, align 4, !dbg !29 + %85 = load i64, ptr %70, align 4, !dbg !29 + %86 = and i64 %85, %74, !dbg !29 + store i64 %86, ptr %70, align 4, !dbg !29 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +87: ; preds = %mask_block_ok.i219 + %88 = add nuw i64 %.02.i220, 1, !dbg !29 + %exitcond.not.i223 = icmp eq i64 %.02.i220, %reass.sub.i208, !dbg !29 + br i1 %exitcond.not.i223, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +mask_block_ok.i219: ; preds = %__barray_check_none_borrowed.exit215, %87 + %.02.i220 = phi i64 [ %88, %87 ], [ 0, %__barray_check_none_borrowed.exit215 ], !dbg !28 + %gep.i221 = getelementptr i64, ptr %64, i64 %.02.i220, !dbg !29 + %89 = load i64, ptr %gep.i221, align 4, !dbg !29 + %90 = icmp eq i64 %89, 0, !dbg !29 + br i1 %90, label %87, label %mask_block_err.i222, !dbg !29 + +mask_block_err.i222: ; preds = %mask_block_ok.i219 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !29 + unreachable, !dbg !29 + +__barray_check_none_borrowed.exit224: ; preds = %87, %__barray_check_none_borrowed.exit215 + %91 = insertvalue { ptr, ptr, i64 } poison, ptr %80, 0, !dbg !28 + %92 = insertvalue { ptr, ptr, i64 } %91, ptr %81, 1, !dbg !28 + %93 = insertvalue { ptr, ptr, i64 } %92, i64 0, 2, !dbg !28 + %94 = insertvalue { ptr, ptr, i64 } poison, ptr %52, 0, !dbg !23 + %95 = insertvalue { ptr, ptr, i64 } %94, ptr %53, 1, !dbg !23 + %96 = insertvalue { ptr, ptr, i64 } %95, i64 0, 2, !dbg !23 + %97 = insertvalue { ptr, ptr, i64 } poison, ptr %23, 0, !dbg !18 + %98 = insertvalue { ptr, ptr, i64 } %97, ptr %24, 1, !dbg !18 + %99 = insertvalue { ptr, ptr, i64 } %98, i64 0, 2, !dbg !18 + tail call void @print_int(ptr nonnull @res_a.19FB4E83.0, i64 10, i64 %0), !dbg !31 + tail call void @print_float(ptr nonnull @res_b.0E048F9C.0, i64 12, double %1), !dbg !32 + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %2), !dbg !33 + %100 = getelementptr inbounds [5 x i64], ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !28 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4, !dbg !28 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8, !dbg !28 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16, !dbg !28 + %101 = alloca [5 x i1], align 1, !dbg !28 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %101, i8 0, i64 5, i1 false), !dbg !28 + store i32 5, ptr %out_arr_alloca, align 8, !dbg !28 + store i32 1, ptr %y_ptr, align 4, !dbg !28 + store ptr %100, ptr %arr_ptr, align 8, !dbg !28 + store ptr %101, ptr %mask_ptr, align 8, !dbg !28 + call void @print_int_arr(ptr nonnull @res_d.93EDD03A.0, i64 13, ptr nonnull %out_arr_alloca), !dbg !28 + %102 = getelementptr inbounds [3 x double], ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + %out_arr_alloca57 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !23 + %y_ptr59 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 4, !dbg !23 + %arr_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 8, !dbg !23 + %mask_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 16, !dbg !23 + %103 = alloca [3 x i1], align 1, !dbg !23 + store i1 false, ptr %103, align 1, !dbg !23 + %.repack171 = getelementptr inbounds nuw i8, ptr %103, i64 1, !dbg !23 + store i1 false, ptr %.repack171, align 1, !dbg !23 + %.repack172 = getelementptr inbounds nuw i8, ptr %103, i64 2, !dbg !23 + store i1 false, ptr %.repack172, align 1, !dbg !23 + store i32 3, ptr %out_arr_alloca57, align 8, !dbg !23 + store i32 1, ptr %y_ptr59, align 4, !dbg !23 + store ptr %102, ptr %arr_ptr60, align 8, !dbg !23 + store ptr %103, ptr %mask_ptr61, align 8, !dbg !23 + call void @print_float_arr(ptr nonnull @res_e.DB2DB1D9.0, i64 15, ptr nonnull %out_arr_alloca57), !dbg !23 + %104 = getelementptr inbounds [8 x i1], ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %out_arr_alloca67 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !18 + %y_ptr69 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 4, !dbg !18 + %arr_ptr70 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 8, !dbg !18 + %mask_ptr71 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 16, !dbg !18 + %105 = alloca [8 x i1], align 8, !dbg !18 + store i64 0, ptr %105, align 8, !dbg !18 + store i32 8, ptr %out_arr_alloca67, align 8, !dbg !18 + store i32 1, ptr %y_ptr69, align 4, !dbg !18 + store ptr %104, ptr %arr_ptr70, align 8, !dbg !18 + store ptr %105, ptr %mask_ptr71, align 8, !dbg !18 + call void @print_bool_arr(ptr nonnull @res_f.173699F1.0, i64 14, ptr nonnull %out_arr_alloca67), !dbg !18 + %mrv = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } poison, { ptr, ptr, i64 } %93, 0 + %mrv89 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv, { ptr, ptr, i64 } %96, 1 + %mrv90 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv89, { ptr, ptr, i64 } %99, 2 + ret { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv90 +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #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 @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_float(ptr, i64, double) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) 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 @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @argreader_get_bool_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_f64_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_i64_array(ptr, ptr, i64) local_unnamed_addr + +declare i1 @argreader_get_bool(ptr) local_unnamed_addr + +declare double @argreader_get_f64(ptr) local_unnamed_addr + +declare i64 @argreader_get_i64(ptr) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !34 { +entry: + tail call void @setup(i64 %0), !dbg !38 + %1 = tail call ptr @heap_alloc(i64 8), !dbg !38 + %2 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %2, align 1, !dbg !38 + %3 = insertvalue { ptr, ptr, i64 } poison, ptr %1, 0, !dbg !38 + %4 = insertvalue { ptr, ptr, i64 } %3, ptr %2, 1, !dbg !38 + %5 = insertvalue { ptr, ptr, i64 } %4, i64 0, 2, !dbg !38 + tail call void @argreader_get_bool_array(ptr nonnull @argument_arg_5.E3E8C60E.0, ptr %1, i64 8), !dbg !38 + %6 = tail call ptr @heap_alloc(i64 24), !dbg !38 + %7 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %7, align 1, !dbg !38 + %8 = insertvalue { ptr, ptr, i64 } poison, ptr %6, 0, !dbg !38 + %9 = insertvalue { ptr, ptr, i64 } %8, ptr %7, 1, !dbg !38 + %10 = insertvalue { ptr, ptr, i64 } %9, i64 0, 2, !dbg !38 + tail call void @argreader_get_f64_array(ptr nonnull @argument_arg_4.43DB6CC9.0, ptr %6, i64 3), !dbg !38 + %11 = tail call ptr @heap_alloc(i64 40), !dbg !38 + %12 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %12, align 1, !dbg !38 + %13 = insertvalue { ptr, ptr, i64 } poison, ptr %11, 0, !dbg !38 + %14 = insertvalue { ptr, ptr, i64 } %13, ptr %12, 1, !dbg !38 + %15 = insertvalue { ptr, ptr, i64 } %14, i64 0, 2, !dbg !38 + tail call void @argreader_get_i64_array(ptr nonnull @argument_arg_3.E6500947.0, ptr %11, i64 5), !dbg !38 + %read_arg_bool.i = tail call i1 @argreader_get_bool(ptr nonnull @argument_arg_2.32BF8FD7.0), !dbg !38 + %read_arg_f64.i = tail call double @argreader_get_f64(ptr nonnull @argument_arg_1.12764F87.0), !dbg !38 + %read_arg_int.i = tail call i64 @argreader_get_i64(ptr nonnull @argument_arg_0.0A040DE9.0), !dbg !38 + %16 = tail call { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %read_arg_int.i, double %read_arg_f64.i, i1 %read_arg_bool.i, { ptr, ptr, i64 } %15, { ptr, ptr, i64 } %10, { ptr, ptr, i64 } %5), !dbg !38 + %17 = tail call i64 @teardown(), !dbg !38 + ret i64 %17, !dbg !38 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } +attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } + +!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.0-a3)-v1.0.0-a3", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "entry_args..foo", linkageName: "__hugr__.__main__.entry_args..foo.1", scope: null, file: !5, line: 247, type: !6, scopeLine: 248, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!6 = !DISubroutineType(types: !7) +!7 = !{!8, !13, !14, !15, !10, !10, !10} +!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } }", file: !2, size: 576, align: 8, elements: !9) +!9 = !{!10, !10, !10} +!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !11) +!11 = !{!12, !12, !13} +!12 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DIBasicType(name: "f64", size: 64, encoding: DW_ATE_float) +!15 = !DIBasicType(name: "i1", size: 1, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !17) +!17 = distinct !DILocation(line: 253, column: 8, scope: !4) +!18 = !DILocation(line: 253, column: 8, scope: !4) +!19 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !20) +!20 = distinct !DILocation(line: 253, column: 8, scope: !4) +!21 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !22) +!22 = distinct !DILocation(line: 252, column: 8, scope: !4) +!23 = !DILocation(line: 252, column: 8, scope: !4) +!24 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !25) +!25 = distinct !DILocation(line: 252, column: 8, scope: !4) +!26 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !27) +!27 = distinct !DILocation(line: 251, column: 8, scope: !4) +!28 = !DILocation(line: 251, column: 8, scope: !4) +!29 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !30) +!30 = distinct !DILocation(line: 251, column: 8, scope: !4) +!31 = !DILocation(line: 248, column: 8, scope: !4) +!32 = !DILocation(line: 249, column: 8, scope: !4) +!33 = !DILocation(line: 250, column: 8, scope: !4) +!34 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !35, type: !36, spFlags: DISPFlagDefinition, unit: !1) +!35 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!36 = !DISubroutineType(types: !37) +!37 = !{!13, !13} +!38 = !DILocation(line: 0, scope: !34) \ No newline at end of file diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_helios index a255f4d06..577b035a3 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37, !dbg !10 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41, !dbg !11 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45, !dbg !13 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios index ba9335a66..1355d4c06 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios @@ -15,157 +15,157 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit, !dbg !9 -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_helios_qalloc.374.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.378.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !9 %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.9, %__hugr__.__tk2_helios_qalloc.374.exit.8, %__hugr__.__tk2_helios_qalloc.374.exit.7, %__hugr__.__tk2_helios_qalloc.374.exit.6, %__hugr__.__tk2_helios_qalloc.374.exit.5, %__hugr__.__tk2_helios_qalloc.374.exit.4, %__hugr__.__tk2_helios_qalloc.374.exit.3, %__hugr__.__tk2_helios_qalloc.374.exit.2, %__hugr__.__tk2_helios_qalloc.374.exit.1, %__hugr__.__tk2_helios_qalloc.374.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.378.exit.8, %__hugr__.__tk2_helios_qalloc.378.exit.7, %__hugr__.__tk2_helios_qalloc.378.exit.6, %__hugr__.__tk2_helios_qalloc.378.exit.5, %__hugr__.__tk2_helios_qalloc.378.exit.4, %__hugr__.__tk2_helios_qalloc.378.exit.3, %__hugr__.__tk2_helios_qalloc.378.exit.2, %__hugr__.__tk2_helios_qalloc.378.exit.1, %__hugr__.__tk2_helios_qalloc.378.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit +cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.378.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(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.1, !dbg !9 -__hugr__.__tk2_helios_qalloc.374.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.378.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not199 = icmp eq i64 %6, 0 br i1 %.not199, label %panic.i, label %cond_exit_20.1 -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.378.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(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.2, !dbg !9 -__hugr__.__tk2_helios_qalloc.374.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.378.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 %9 = load i64, ptr %1, align 4 %10 = and i64 %9, 4 %.not200 = icmp eq i64 %10, 0 br i1 %.not200, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.378.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(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.3, !dbg !9 -__hugr__.__tk2_helios_qalloc.374.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_helios_qalloc.378.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 %13 = load i64, ptr %1, align 4 %14 = and i64 %13, 8 %.not201 = icmp eq i64 %14, 0 br i1 %.not201, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.378.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(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.4, !dbg !9 -__hugr__.__tk2_helios_qalloc.374.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_helios_qalloc.378.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 %17 = load i64, ptr %1, align 4 %18 = and i64 %17, 16 %.not202 = icmp eq i64 %18, 0 br i1 %.not202, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.378.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(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.5, !dbg !9 -__hugr__.__tk2_helios_qalloc.374.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_helios_qalloc.378.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 %21 = load i64, ptr %1, align 4 %22 = and i64 %21, 32 %.not203 = icmp eq i64 %22, 0 br i1 %.not203, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.378.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(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.6, !dbg !9 -__hugr__.__tk2_helios_qalloc.374.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_helios_qalloc.378.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 %25 = load i64, ptr %1, align 4 %26 = and i64 %25, 64 %.not204 = icmp eq i64 %26, 0 br i1 %.not204, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.378.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(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.7, !dbg !9 -__hugr__.__tk2_helios_qalloc.374.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_helios_qalloc.378.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 %29 = load i64, ptr %1, align 4 %30 = and i64 %29, 128 %.not205 = icmp eq i64 %30, 0 br i1 %.not205, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.378.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(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.8, !dbg !9 -__hugr__.__tk2_helios_qalloc.374.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_helios_qalloc.378.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 %33 = load i64, ptr %1, align 4 %34 = and i64 %33, 256 %.not206 = icmp eq i64 %34, 0 br i1 %.not206, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.378.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(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -399,16 +399,16 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 - %117 = lshr i64 %"421_1.sroa.10.0.i.i", 6 - %118 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %117 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 + %117 = lshr i64 %"425_1.sroa.10.0.i.i", 6 + %118 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %117 %119 = load i64, ptr %118, align 4 - %120 = and i64 %"421_1.sroa.10.0.i.i", 63 + %120 = and i64 %"425_1.sroa.10.0.i.i", 63 %121 = lshr i64 %119, %120 %122 = trunc i64 %121 to i1 - br i1 %122, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %122, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" %123 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" ], [ %265, %loop_body.i177 ] @@ -452,8 +452,8 @@ panic.i222.i.i: ; preds = %__barray_check_boun %exitcond.not.i.i.i185 = icmp eq i64 %.02.i.i.i182, %reass.sub.i.i.i179, !dbg !72 br i1 %exitcond.not.i.i.i185, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i181, !dbg !72 -mask_block_ok.i.i.i181: ; preds = %cond_exit_424.thread.9.i.i, %139 - %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_424.thread.9.i.i ] +mask_block_ok.i.i.i181: ; preds = %cond_exit_428.thread.9.i.i, %139 + %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_428.thread.9.i.i ] %gep.i.i.i183 = getelementptr i64, ptr %118, i64 %.02.i.i.i182, !dbg !72 %141 = load i64, ptr %gep.i.i.i183, align 4, !dbg !72 %142 = icmp eq i64 %141, -1, !dbg !72 @@ -467,183 +467,183 @@ __barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader %143 = shl nuw i64 1, %120, !dbg !71 %144 = xor i64 %119, %143, !dbg !71 store i64 %144, ptr %118, align 4, !dbg !71 - %145 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %"421_1.sroa.10.0.i.i" + %145 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %"425_1.sroa.10.0.i.i" %146 = load i64, ptr %145, align 4 tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %147 = add i64 %"421_1.sroa.10.0.i.i", 1 +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i + %147 = add i64 %"425_1.sroa.10.0.i.i", 1 %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %148 + %149 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i + br i1 %153, label %cond_exit_428.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_424.thread.i.i +__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_428.thread.i.i %154 = shl nuw i64 1, %151, !dbg !71 %155 = xor i64 %150, %154, !dbg !71 store i64 %155, ptr %149, align 4, !dbg !71 - %156 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %147 + %156 = getelementptr inbounds i64, ptr %"425_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_424.thread.1.i.i + br label %cond_exit_428.thread.1.i.i -cond_exit_424.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_424.thread.i.i - %158 = add i64 %"421_1.sroa.10.0.i.i", 2 +cond_exit_428.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_428.thread.i.i + %158 = add i64 %"425_1.sroa.10.0.i.i", 2 %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i + br i1 %164, label %cond_exit_428.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_424.thread.1.i.i +__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_428.thread.1.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %161, %165, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.2.i.i + br label %cond_exit_428.thread.2.i.i -cond_exit_424.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_424.thread.1.i.i - %169 = add i64 %"421_1.sroa.10.0.i.i", 3 +cond_exit_428.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_428.thread.1.i.i + %169 = add i64 %"425_1.sroa.10.0.i.i", 3 %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %170 + %171 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i + br i1 %175, label %cond_exit_428.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_424.thread.2.i.i +__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_428.thread.2.i.i %176 = shl nuw i64 1, %173, !dbg !71 %177 = xor i64 %172, %176, !dbg !71 store i64 %177, ptr %171, align 4, !dbg !71 - %178 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %169 + %178 = getelementptr inbounds i64, ptr %"425_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_424.thread.3.i.i + br label %cond_exit_428.thread.3.i.i -cond_exit_424.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_424.thread.2.i.i - %180 = add i64 %"421_1.sroa.10.0.i.i", 4 +cond_exit_428.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_428.thread.2.i.i + %180 = add i64 %"425_1.sroa.10.0.i.i", 4 %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %181 + %182 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i + br i1 %186, label %cond_exit_428.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_424.thread.3.i.i +__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_428.thread.3.i.i %187 = shl nuw i64 1, %184, !dbg !71 %188 = xor i64 %183, %187, !dbg !71 store i64 %188, ptr %182, align 4, !dbg !71 - %189 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %180 + %189 = getelementptr inbounds i64, ptr %"425_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_424.thread.4.i.i + br label %cond_exit_428.thread.4.i.i -cond_exit_424.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_424.thread.3.i.i - %191 = add i64 %"421_1.sroa.10.0.i.i", 5 +cond_exit_428.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_428.thread.3.i.i + %191 = add i64 %"425_1.sroa.10.0.i.i", 5 %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %192 + %193 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i + br i1 %197, label %cond_exit_428.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_424.thread.4.i.i +__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_428.thread.4.i.i %198 = shl nuw i64 1, %195, !dbg !71 %199 = xor i64 %194, %198, !dbg !71 store i64 %199, ptr %193, align 4, !dbg !71 - %200 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %191 + %200 = getelementptr inbounds i64, ptr %"425_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_424.thread.5.i.i + br label %cond_exit_428.thread.5.i.i -cond_exit_424.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_424.thread.4.i.i - %202 = add i64 %"421_1.sroa.10.0.i.i", 6 +cond_exit_428.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_428.thread.4.i.i + %202 = add i64 %"425_1.sroa.10.0.i.i", 6 %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %203 + %204 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i + br i1 %208, label %cond_exit_428.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_424.thread.5.i.i +__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_428.thread.5.i.i %209 = shl nuw i64 1, %206, !dbg !71 %210 = xor i64 %205, %209, !dbg !71 store i64 %210, ptr %204, align 4, !dbg !71 - %211 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %202 + %211 = getelementptr inbounds i64, ptr %"425_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_424.thread.6.i.i + br label %cond_exit_428.thread.6.i.i -cond_exit_424.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_424.thread.5.i.i - %213 = add i64 %"421_1.sroa.10.0.i.i", 7 +cond_exit_428.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_428.thread.5.i.i + %213 = add i64 %"425_1.sroa.10.0.i.i", 7 %214 = lshr i64 %213, 6 - %215 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %214 + %215 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %214 %216 = load i64, ptr %215, align 4 %217 = and i64 %213, 63 %218 = lshr i64 %216, %217 %219 = trunc i64 %218 to i1 - br i1 %219, label %cond_exit_424.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i + br i1 %219, label %cond_exit_428.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_424.thread.6.i.i +__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_428.thread.6.i.i %220 = shl nuw i64 1, %217, !dbg !71 %221 = xor i64 %216, %220, !dbg !71 store i64 %221, ptr %215, align 4, !dbg !71 - %222 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %213 + %222 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %213 %223 = load i64, ptr %222, align 4 tail call void @___dec_future_refcount(i64 %223) - br label %cond_exit_424.thread.7.i.i + br label %cond_exit_428.thread.7.i.i -cond_exit_424.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_424.thread.6.i.i - %224 = add i64 %"421_1.sroa.10.0.i.i", 8 +cond_exit_428.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_428.thread.6.i.i + %224 = add i64 %"425_1.sroa.10.0.i.i", 8 %225 = lshr i64 %224, 6 - %226 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %225 + %226 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %225 %227 = load i64, ptr %226, align 4 %228 = and i64 %224, 63 %229 = lshr i64 %227, %228 %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_424.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i + br i1 %230, label %cond_exit_428.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_424.thread.7.i.i +__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_428.thread.7.i.i %231 = shl nuw i64 1, %228, !dbg !71 %232 = xor i64 %227, %231, !dbg !71 store i64 %232, ptr %226, align 4, !dbg !71 - %233 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %224 + %233 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %224 %234 = load i64, ptr %233, align 4 tail call void @___dec_future_refcount(i64 %234) - br label %cond_exit_424.thread.8.i.i + br label %cond_exit_428.thread.8.i.i -cond_exit_424.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_424.thread.7.i.i - %235 = add i64 %"421_1.sroa.10.0.i.i", 9 +cond_exit_428.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_428.thread.7.i.i + %235 = add i64 %"425_1.sroa.10.0.i.i", 9 %236 = lshr i64 %235, 6 - %237 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %236 + %237 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %236 %238 = load i64, ptr %237, align 4 %239 = and i64 %235, 63 %240 = lshr i64 %238, %239 %241 = trunc i64 %240 to i1 - br i1 %241, label %cond_exit_424.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i + br i1 %241, label %cond_exit_428.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_424.thread.8.i.i +__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_428.thread.8.i.i %242 = shl nuw i64 1, %239, !dbg !71 %243 = xor i64 %238, %242, !dbg !71 store i64 %243, ptr %237, align 4, !dbg !71 - %244 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %235 + %244 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %235 %245 = load i64, ptr %244, align 4 tail call void @___dec_future_refcount(i64 %245) - br label %cond_exit_424.thread.9.i.i + br label %cond_exit_428.thread.9.i.i -cond_exit_424.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_424.thread.8.i.i +cond_exit_428.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_428.thread.8.i.i %246 = load i64, ptr %118, align 4, !dbg !72 %247 = sub nuw nsw i64 64, %120, !dbg !72 %248 = lshr i64 -1, %247, !dbg !72 @@ -687,9 +687,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %124, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_424.thread.9.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_428.thread.9.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %115) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios index f45055a42..5ff89fdb1 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit, !dbg !8 -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios index 683dd0e3d..4b27f8d94 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit, !dbg !8 -cond_44_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"), !dbg !8 unreachable, !dbg !8 -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios index e7ef79fd4..2e81ff3ad 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit, !dbg !8 -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.38.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.42.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios index 4578def41..e44553352 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 + %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios index 6a34358aa..a9e6ed085 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit, !dbg !8 -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] +__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i, !dbg !15 -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios index 4a439c466..86e543e5a 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios @@ -14,9 +14,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_225_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_229_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-entry_args/entry_args_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-entry_args/entry_args_x86_64-apple-darwin_helios new file mode 100644 index 000000000..47fefc5f7 --- /dev/null +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-entry_args/entry_args_x86_64-apple-darwin_helios @@ -0,0 +1,408 @@ +; 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_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_a.19FB4E83.0 = private constant [11 x i8] c"\0AUSER:INT:a" +@res_b.0E048F9C.0 = private constant [13 x i8] c"\0CUSER:FLOAT:b" +@res_c.1C9EF4D1.0 = private constant [12 x i8] c"\0BUSER:BOOL:c" +@res_d.93EDD03A.0 = private constant [14 x i8] c"\0DUSER:INTARR:d" +@res_e.DB2DB1D9.0 = private constant [16 x i8] c"\0FUSER:FLOATARR:e" +@res_f.173699F1.0 = private constant [15 x i8] c"\0EUSER:BOOLARR:f" +@argument_arg_5.E3E8C60E.0 = private constant [6 x i8] c"\05arg_5" +@argument_arg_4.43DB6CC9.0 = private constant [6 x i8] c"\05arg_4" +@argument_arg_3.E6500947.0 = private constant [6 x i8] c"\05arg_3" +@argument_arg_2.32BF8FD7.0 = private constant [6 x i8] c"\05arg_2" +@argument_arg_1.12764F87.0 = private constant [6 x i8] c"\05arg_1" +@argument_arg_0.0A040DE9.0 = private constant [6 x i8] c"\05arg_0" + +define { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %0, double %1, i1 %2, { ptr, ptr, i64 } %3, { ptr, ptr, i64 } %4, { ptr, ptr, i64 } %5) local_unnamed_addr !dbg !4 { +alloca_block: + %.fca.0.extract161 = extractvalue { ptr, ptr, i64 } %3, 0 + %.fca.1.extract163 = extractvalue { ptr, ptr, i64 } %3, 1 + %.fca.2.extract165 = extractvalue { ptr, ptr, i64 } %3, 2 + %.fca.0.extract155 = extractvalue { ptr, ptr, i64 } %4, 0 + %.fca.1.extract157 = extractvalue { ptr, ptr, i64 } %4, 1 + %.fca.2.extract159 = extractvalue { ptr, ptr, i64 } %4, 2 + %.fca.0.extract149 = extractvalue { ptr, ptr, i64 } %5, 0 + %.fca.1.extract151 = extractvalue { ptr, ptr, i64 } %5, 1 + %.fca.2.extract153 = extractvalue { ptr, ptr, i64 } %5, 2 + %6 = lshr i64 %.fca.2.extract153, 6, !dbg !16 + %7 = getelementptr i64, ptr %.fca.1.extract151, i64 %6, !dbg !16 + %8 = load i64, ptr %7, align 4, !dbg !16 + %9 = and i64 %.fca.2.extract153, 63, !dbg !16 + %10 = shl nsw i64 -1, %9, !dbg !16 + %11 = and i64 %8, %10, !dbg !16 + store i64 %11, ptr %7, align 4, !dbg !16 + %last_valid.i = add i64 %.fca.2.extract153, 7, !dbg !16 + %12 = lshr i64 %last_valid.i, 6, !dbg !16 + %13 = getelementptr inbounds nuw i64, ptr %.fca.1.extract151, i64 %12, !dbg !16 + %14 = load i64, ptr %13, align 4, !dbg !16 + %15 = and i64 %last_valid.i, 63, !dbg !16 + %16 = xor i64 %15, 63, !dbg !16 + %17 = lshr i64 -1, %16, !dbg !16 + %18 = and i64 %14, %17, !dbg !16 + store i64 %18, ptr %13, align 4, !dbg !16 + %reass.sub.i = sub nsw i64 %12, %6, !dbg !16 + %.not.i = icmp eq i64 %reass.sub.i, -1, !dbg !16 + br i1 %.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +19: ; preds = %mask_block_ok.i + %20 = add nuw i64 %.02.i, 1, !dbg !16 + %exitcond.not.i = icmp eq i64 %.02.i, %reass.sub.i, !dbg !16 + br i1 %exitcond.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +mask_block_ok.i: ; preds = %alloca_block, %19 + %.02.i = phi i64 [ %20, %19 ], [ 0, %alloca_block ], !dbg !18 + %gep.i = getelementptr i64, ptr %7, i64 %.02.i, !dbg !16 + %21 = load i64, ptr %gep.i, align 4, !dbg !16 + %22 = icmp eq i64 %21, 0, !dbg !16 + br i1 %22, label %19, label %mask_block_err.i, !dbg !16 + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !16 + unreachable, !dbg !16 + +__barray_check_none_borrowed.exit: ; preds = %19, %alloca_block + %23 = tail call ptr @heap_alloc(i64 8), !dbg !18 + %24 = tail call ptr @heap_alloc(i64 8), !dbg !18 + store i64 0, ptr %24, align 1, !dbg !18 + %25 = getelementptr inbounds i1, ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %26 = load i64, ptr %25, align 1, !dbg !18 + store i64 %26, ptr %23, align 1, !dbg !18 + %27 = load i64, ptr %7, align 4, !dbg !19 + %28 = and i64 %27, %10, !dbg !19 + store i64 %28, ptr %7, align 4, !dbg !19 + %29 = load i64, ptr %13, align 4, !dbg !19 + %30 = and i64 %29, %17, !dbg !19 + store i64 %30, ptr %13, align 4, !dbg !19 + br i1 %.not.i, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +31: ; preds = %mask_block_ok.i183 + %32 = add nuw i64 %.02.i184, 1, !dbg !19 + %exitcond.not.i187 = icmp eq i64 %.02.i184, %reass.sub.i, !dbg !19 + br i1 %exitcond.not.i187, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +mask_block_ok.i183: ; preds = %__barray_check_none_borrowed.exit, %31 + %.02.i184 = phi i64 [ %32, %31 ], [ 0, %__barray_check_none_borrowed.exit ], !dbg !18 + %gep.i185 = getelementptr i64, ptr %7, i64 %.02.i184, !dbg !19 + %33 = load i64, ptr %gep.i185, align 4, !dbg !19 + %34 = icmp eq i64 %33, 0, !dbg !19 + br i1 %34, label %31, label %mask_block_err.i186, !dbg !19 + +mask_block_err.i186: ; preds = %mask_block_ok.i183 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !19 + unreachable, !dbg !19 + +__barray_check_none_borrowed.exit188: ; preds = %31, %__barray_check_none_borrowed.exit + %35 = lshr i64 %.fca.2.extract159, 6, !dbg !21 + %36 = getelementptr i64, ptr %.fca.1.extract157, i64 %35, !dbg !21 + %37 = load i64, ptr %36, align 4, !dbg !21 + %38 = and i64 %.fca.2.extract159, 63, !dbg !21 + %39 = shl nsw i64 -1, %38, !dbg !21 + %40 = and i64 %37, %39, !dbg !21 + store i64 %40, ptr %36, align 4, !dbg !21 + %last_valid.i189 = add i64 %.fca.2.extract159, 2, !dbg !21 + %41 = lshr i64 %last_valid.i189, 6, !dbg !21 + %42 = getelementptr inbounds nuw i64, ptr %.fca.1.extract157, i64 %41, !dbg !21 + %43 = load i64, ptr %42, align 4, !dbg !21 + %44 = and i64 %last_valid.i189, 63, !dbg !21 + %45 = xor i64 %44, 63, !dbg !21 + %46 = lshr i64 -1, %45, !dbg !21 + %47 = and i64 %43, %46, !dbg !21 + store i64 %47, ptr %42, align 4, !dbg !21 + %reass.sub.i190 = sub nsw i64 %41, %35, !dbg !21 + %.not.i191 = icmp eq i64 %reass.sub.i190, -1, !dbg !21 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +48: ; preds = %mask_block_ok.i192 + %49 = add nuw i64 %.02.i193, 1, !dbg !21 + %exitcond.not.i196 = icmp eq i64 %.02.i193, %reass.sub.i190, !dbg !21 + br i1 %exitcond.not.i196, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +mask_block_ok.i192: ; preds = %__barray_check_none_borrowed.exit188, %48 + %.02.i193 = phi i64 [ %49, %48 ], [ 0, %__barray_check_none_borrowed.exit188 ], !dbg !23 + %gep.i194 = getelementptr i64, ptr %36, i64 %.02.i193, !dbg !21 + %50 = load i64, ptr %gep.i194, align 4, !dbg !21 + %51 = icmp eq i64 %50, 0, !dbg !21 + br i1 %51, label %48, label %mask_block_err.i195, !dbg !21 + +mask_block_err.i195: ; preds = %mask_block_ok.i192 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !21 + unreachable, !dbg !21 + +__barray_check_none_borrowed.exit197: ; preds = %48, %__barray_check_none_borrowed.exit188 + %52 = tail call ptr @heap_alloc(i64 24), !dbg !23 + %53 = tail call ptr @heap_alloc(i64 8), !dbg !23 + store i64 0, ptr %53, align 1, !dbg !23 + %54 = getelementptr inbounds double, ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(24) %52, ptr noundef nonnull align 1 dereferenceable(24) %54, i64 24, i1 false), !dbg !23 + %55 = load i64, ptr %36, align 4, !dbg !24 + %56 = and i64 %55, %39, !dbg !24 + store i64 %56, ptr %36, align 4, !dbg !24 + %57 = load i64, ptr %42, align 4, !dbg !24 + %58 = and i64 %57, %46, !dbg !24 + store i64 %58, ptr %42, align 4, !dbg !24 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +59: ; preds = %mask_block_ok.i201 + %60 = add nuw i64 %.02.i202, 1, !dbg !24 + %exitcond.not.i205 = icmp eq i64 %.02.i202, %reass.sub.i190, !dbg !24 + br i1 %exitcond.not.i205, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +mask_block_ok.i201: ; preds = %__barray_check_none_borrowed.exit197, %59 + %.02.i202 = phi i64 [ %60, %59 ], [ 0, %__barray_check_none_borrowed.exit197 ], !dbg !23 + %gep.i203 = getelementptr i64, ptr %36, i64 %.02.i202, !dbg !24 + %61 = load i64, ptr %gep.i203, align 4, !dbg !24 + %62 = icmp eq i64 %61, 0, !dbg !24 + br i1 %62, label %59, label %mask_block_err.i204, !dbg !24 + +mask_block_err.i204: ; preds = %mask_block_ok.i201 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !24 + unreachable, !dbg !24 + +__barray_check_none_borrowed.exit206: ; preds = %59, %__barray_check_none_borrowed.exit197 + %63 = lshr i64 %.fca.2.extract165, 6, !dbg !26 + %64 = getelementptr i64, ptr %.fca.1.extract163, i64 %63, !dbg !26 + %65 = load i64, ptr %64, align 4, !dbg !26 + %66 = and i64 %.fca.2.extract165, 63, !dbg !26 + %67 = shl nsw i64 -1, %66, !dbg !26 + %68 = and i64 %65, %67, !dbg !26 + store i64 %68, ptr %64, align 4, !dbg !26 + %last_valid.i207 = add i64 %.fca.2.extract165, 4, !dbg !26 + %69 = lshr i64 %last_valid.i207, 6, !dbg !26 + %70 = getelementptr inbounds nuw i64, ptr %.fca.1.extract163, i64 %69, !dbg !26 + %71 = load i64, ptr %70, align 4, !dbg !26 + %72 = and i64 %last_valid.i207, 63, !dbg !26 + %73 = xor i64 %72, 63, !dbg !26 + %74 = lshr i64 -1, %73, !dbg !26 + %75 = and i64 %71, %74, !dbg !26 + store i64 %75, ptr %70, align 4, !dbg !26 + %reass.sub.i208 = sub nsw i64 %69, %63, !dbg !26 + %.not.i209 = icmp eq i64 %reass.sub.i208, -1, !dbg !26 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +76: ; preds = %mask_block_ok.i210 + %77 = add nuw i64 %.02.i211, 1, !dbg !26 + %exitcond.not.i214 = icmp eq i64 %.02.i211, %reass.sub.i208, !dbg !26 + br i1 %exitcond.not.i214, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +mask_block_ok.i210: ; preds = %__barray_check_none_borrowed.exit206, %76 + %.02.i211 = phi i64 [ %77, %76 ], [ 0, %__barray_check_none_borrowed.exit206 ], !dbg !28 + %gep.i212 = getelementptr i64, ptr %64, i64 %.02.i211, !dbg !26 + %78 = load i64, ptr %gep.i212, align 4, !dbg !26 + %79 = icmp eq i64 %78, 0, !dbg !26 + br i1 %79, label %76, label %mask_block_err.i213, !dbg !26 + +mask_block_err.i213: ; preds = %mask_block_ok.i210 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !26 + unreachable, !dbg !26 + +__barray_check_none_borrowed.exit215: ; preds = %76, %__barray_check_none_borrowed.exit206 + %80 = tail call ptr @heap_alloc(i64 40), !dbg !28 + %81 = tail call ptr @heap_alloc(i64 8), !dbg !28 + store i64 0, ptr %81, align 1, !dbg !28 + %82 = getelementptr inbounds i64, ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(40) %80, ptr noundef nonnull align 1 dereferenceable(40) %82, i64 40, i1 false), !dbg !28 + %83 = load i64, ptr %64, align 4, !dbg !29 + %84 = and i64 %83, %67, !dbg !29 + store i64 %84, ptr %64, align 4, !dbg !29 + %85 = load i64, ptr %70, align 4, !dbg !29 + %86 = and i64 %85, %74, !dbg !29 + store i64 %86, ptr %70, align 4, !dbg !29 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +87: ; preds = %mask_block_ok.i219 + %88 = add nuw i64 %.02.i220, 1, !dbg !29 + %exitcond.not.i223 = icmp eq i64 %.02.i220, %reass.sub.i208, !dbg !29 + br i1 %exitcond.not.i223, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +mask_block_ok.i219: ; preds = %__barray_check_none_borrowed.exit215, %87 + %.02.i220 = phi i64 [ %88, %87 ], [ 0, %__barray_check_none_borrowed.exit215 ], !dbg !28 + %gep.i221 = getelementptr i64, ptr %64, i64 %.02.i220, !dbg !29 + %89 = load i64, ptr %gep.i221, align 4, !dbg !29 + %90 = icmp eq i64 %89, 0, !dbg !29 + br i1 %90, label %87, label %mask_block_err.i222, !dbg !29 + +mask_block_err.i222: ; preds = %mask_block_ok.i219 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !29 + unreachable, !dbg !29 + +__barray_check_none_borrowed.exit224: ; preds = %87, %__barray_check_none_borrowed.exit215 + %91 = insertvalue { ptr, ptr, i64 } poison, ptr %80, 0, !dbg !28 + %92 = insertvalue { ptr, ptr, i64 } %91, ptr %81, 1, !dbg !28 + %93 = insertvalue { ptr, ptr, i64 } %92, i64 0, 2, !dbg !28 + %94 = insertvalue { ptr, ptr, i64 } poison, ptr %52, 0, !dbg !23 + %95 = insertvalue { ptr, ptr, i64 } %94, ptr %53, 1, !dbg !23 + %96 = insertvalue { ptr, ptr, i64 } %95, i64 0, 2, !dbg !23 + %97 = insertvalue { ptr, ptr, i64 } poison, ptr %23, 0, !dbg !18 + %98 = insertvalue { ptr, ptr, i64 } %97, ptr %24, 1, !dbg !18 + %99 = insertvalue { ptr, ptr, i64 } %98, i64 0, 2, !dbg !18 + tail call void @print_int(ptr nonnull @res_a.19FB4E83.0, i64 10, i64 %0), !dbg !31 + tail call void @print_float(ptr nonnull @res_b.0E048F9C.0, i64 12, double %1), !dbg !32 + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %2), !dbg !33 + %100 = getelementptr inbounds [5 x i64], ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !28 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4, !dbg !28 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8, !dbg !28 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16, !dbg !28 + %101 = alloca [5 x i1], align 1, !dbg !28 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %101, i8 0, i64 5, i1 false), !dbg !28 + store i32 5, ptr %out_arr_alloca, align 8, !dbg !28 + store i32 1, ptr %y_ptr, align 4, !dbg !28 + store ptr %100, ptr %arr_ptr, align 8, !dbg !28 + store ptr %101, ptr %mask_ptr, align 8, !dbg !28 + call void @print_int_arr(ptr nonnull @res_d.93EDD03A.0, i64 13, ptr nonnull %out_arr_alloca), !dbg !28 + %102 = getelementptr inbounds [3 x double], ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + %out_arr_alloca57 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !23 + %y_ptr59 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 4, !dbg !23 + %arr_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 8, !dbg !23 + %mask_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 16, !dbg !23 + %103 = alloca [3 x i1], align 1, !dbg !23 + store i1 false, ptr %103, align 1, !dbg !23 + %.repack171 = getelementptr inbounds nuw i8, ptr %103, i64 1, !dbg !23 + store i1 false, ptr %.repack171, align 1, !dbg !23 + %.repack172 = getelementptr inbounds nuw i8, ptr %103, i64 2, !dbg !23 + store i1 false, ptr %.repack172, align 1, !dbg !23 + store i32 3, ptr %out_arr_alloca57, align 8, !dbg !23 + store i32 1, ptr %y_ptr59, align 4, !dbg !23 + store ptr %102, ptr %arr_ptr60, align 8, !dbg !23 + store ptr %103, ptr %mask_ptr61, align 8, !dbg !23 + call void @print_float_arr(ptr nonnull @res_e.DB2DB1D9.0, i64 15, ptr nonnull %out_arr_alloca57), !dbg !23 + %104 = getelementptr inbounds [8 x i1], ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %out_arr_alloca67 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !18 + %y_ptr69 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 4, !dbg !18 + %arr_ptr70 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 8, !dbg !18 + %mask_ptr71 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 16, !dbg !18 + %105 = alloca [8 x i1], align 8, !dbg !18 + store i64 0, ptr %105, align 8, !dbg !18 + store i32 8, ptr %out_arr_alloca67, align 8, !dbg !18 + store i32 1, ptr %y_ptr69, align 4, !dbg !18 + store ptr %104, ptr %arr_ptr70, align 8, !dbg !18 + store ptr %105, ptr %mask_ptr71, align 8, !dbg !18 + call void @print_bool_arr(ptr nonnull @res_f.173699F1.0, i64 14, ptr nonnull %out_arr_alloca67), !dbg !18 + %mrv = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } poison, { ptr, ptr, i64 } %93, 0 + %mrv89 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv, { ptr, ptr, i64 } %96, 1 + %mrv90 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv89, { ptr, ptr, i64 } %99, 2 + ret { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv90 +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #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 @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_float(ptr, i64, double) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) 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 @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @argreader_get_bool_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_f64_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_i64_array(ptr, ptr, i64) local_unnamed_addr + +declare i1 @argreader_get_bool(ptr) local_unnamed_addr + +declare double @argreader_get_f64(ptr) local_unnamed_addr + +declare i64 @argreader_get_i64(ptr) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !34 { +entry: + tail call void @setup(i64 %0), !dbg !38 + %1 = tail call ptr @heap_alloc(i64 8), !dbg !38 + %2 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %2, align 1, !dbg !38 + %3 = insertvalue { ptr, ptr, i64 } poison, ptr %1, 0, !dbg !38 + %4 = insertvalue { ptr, ptr, i64 } %3, ptr %2, 1, !dbg !38 + %5 = insertvalue { ptr, ptr, i64 } %4, i64 0, 2, !dbg !38 + tail call void @argreader_get_bool_array(ptr nonnull @argument_arg_5.E3E8C60E.0, ptr %1, i64 8), !dbg !38 + %6 = tail call ptr @heap_alloc(i64 24), !dbg !38 + %7 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %7, align 1, !dbg !38 + %8 = insertvalue { ptr, ptr, i64 } poison, ptr %6, 0, !dbg !38 + %9 = insertvalue { ptr, ptr, i64 } %8, ptr %7, 1, !dbg !38 + %10 = insertvalue { ptr, ptr, i64 } %9, i64 0, 2, !dbg !38 + tail call void @argreader_get_f64_array(ptr nonnull @argument_arg_4.43DB6CC9.0, ptr %6, i64 3), !dbg !38 + %11 = tail call ptr @heap_alloc(i64 40), !dbg !38 + %12 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %12, align 1, !dbg !38 + %13 = insertvalue { ptr, ptr, i64 } poison, ptr %11, 0, !dbg !38 + %14 = insertvalue { ptr, ptr, i64 } %13, ptr %12, 1, !dbg !38 + %15 = insertvalue { ptr, ptr, i64 } %14, i64 0, 2, !dbg !38 + tail call void @argreader_get_i64_array(ptr nonnull @argument_arg_3.E6500947.0, ptr %11, i64 5), !dbg !38 + %read_arg_bool.i = tail call i1 @argreader_get_bool(ptr nonnull @argument_arg_2.32BF8FD7.0), !dbg !38 + %read_arg_f64.i = tail call double @argreader_get_f64(ptr nonnull @argument_arg_1.12764F87.0), !dbg !38 + %read_arg_int.i = tail call i64 @argreader_get_i64(ptr nonnull @argument_arg_0.0A040DE9.0), !dbg !38 + %16 = tail call { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %read_arg_int.i, double %read_arg_f64.i, i1 %read_arg_bool.i, { ptr, ptr, i64 } %15, { ptr, ptr, i64 } %10, { ptr, ptr, i64 } %5), !dbg !38 + %17 = tail call i64 @teardown(), !dbg !38 + ret i64 %17, !dbg !38 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } +attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } + +!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.0-a3)-v1.0.0-a3", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "entry_args..foo", linkageName: "__hugr__.__main__.entry_args..foo.1", scope: null, file: !5, line: 247, type: !6, scopeLine: 248, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!6 = !DISubroutineType(types: !7) +!7 = !{!8, !13, !14, !15, !10, !10, !10} +!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } }", file: !2, size: 576, align: 8, elements: !9) +!9 = !{!10, !10, !10} +!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !11) +!11 = !{!12, !12, !13} +!12 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DIBasicType(name: "f64", size: 64, encoding: DW_ATE_float) +!15 = !DIBasicType(name: "i1", size: 1, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !17) +!17 = distinct !DILocation(line: 253, column: 8, scope: !4) +!18 = !DILocation(line: 253, column: 8, scope: !4) +!19 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !20) +!20 = distinct !DILocation(line: 253, column: 8, scope: !4) +!21 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !22) +!22 = distinct !DILocation(line: 252, column: 8, scope: !4) +!23 = !DILocation(line: 252, column: 8, scope: !4) +!24 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !25) +!25 = distinct !DILocation(line: 252, column: 8, scope: !4) +!26 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !27) +!27 = distinct !DILocation(line: 251, column: 8, scope: !4) +!28 = !DILocation(line: 251, column: 8, scope: !4) +!29 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !30) +!30 = distinct !DILocation(line: 251, column: 8, scope: !4) +!31 = !DILocation(line: 248, column: 8, scope: !4) +!32 = !DILocation(line: 249, column: 8, scope: !4) +!33 = !DILocation(line: 250, column: 8, scope: !4) +!34 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !35, type: !36, spFlags: DISPFlagDefinition, unit: !1) +!35 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!36 = !DISubroutineType(types: !37) +!37 = !{!13, !13} +!38 = !DILocation(line: 0, scope: !34) \ No newline at end of file diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios index 02b081030..4bc84d301 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37, !dbg !10 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41, !dbg !11 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45, !dbg !13 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios index a33b7e584..954ab09e1 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios @@ -15,9 +15,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i - %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6, !dbg !72 - %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136, !dbg !72 +cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i + %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6, !dbg !72 + %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136, !dbg !72 %138 = load i64, ptr %137, align 4, !dbg !72 - %139 = and i64 %"421_1.sroa.10.0.i.i", 63, !dbg !72 + %139 = and i64 %"425_1.sroa.10.0.i.i", 63, !dbg !72 %140 = sub nuw nsw i64 64, %139, !dbg !72 %141 = lshr i64 -1, %140, !dbg !72 %142 = icmp eq i64 %139, 0, !dbg !72 %143 = select i1 %142, i64 0, i64 %141, !dbg !72 %144 = or i64 %138, %143, !dbg !72 store i64 %144, ptr %137, align 4, !dbg !72 - %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9, !dbg !72 + %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9, !dbg !72 %145 = lshr i64 %last_valid.i.i.i179, 6, !dbg !72 - %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145, !dbg !72 + %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145, !dbg !72 %147 = load i64, ptr %146, align 4, !dbg !72 %148 = and i64 %last_valid.i.i.i179, 63, !dbg !72 %149 = shl nsw i64 -2, %148, !dbg !72 @@ -474,8 +474,8 @@ cond_424_case_0.i.i: ; preds = %cond_exit_424.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180, !dbg !72 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182, !dbg !72 -mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183, !dbg !72 %155 = load i64, ptr %gep.i.i.i184, align 4, !dbg !72 %156 = icmp eq i64 %155, -1, !dbg !72 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0"), !dbg !72 unreachable, !dbg !72 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i - %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] - %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 - %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i + %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] + %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 + %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %165, %161, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios index a10af30b2..cd7fba578 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit, !dbg !8 -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios index a33c9f181..73487432c 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit, !dbg !8 -cond_44_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"), !dbg !8 unreachable, !dbg !8 -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios index a78652c27..b89f80a1b 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit, !dbg !8 -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.38.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.42.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios index f778f2dd0..a289e68a7 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 + %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios index fe6d6856a..cc1a94321 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit, !dbg !8 -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] +__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i, !dbg !15 -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios index c2fe49921..3a2218ef8 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios @@ -14,9 +14,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_225_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_229_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-entry_args/entry_args_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-entry_args/entry_args_x86_64-unknown-linux-gnu_helios new file mode 100644 index 000000000..0df579389 --- /dev/null +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-entry_args/entry_args_x86_64-unknown-linux-gnu_helios @@ -0,0 +1,408 @@ +; 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_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_a.19FB4E83.0 = private constant [11 x i8] c"\0AUSER:INT:a" +@res_b.0E048F9C.0 = private constant [13 x i8] c"\0CUSER:FLOAT:b" +@res_c.1C9EF4D1.0 = private constant [12 x i8] c"\0BUSER:BOOL:c" +@res_d.93EDD03A.0 = private constant [14 x i8] c"\0DUSER:INTARR:d" +@res_e.DB2DB1D9.0 = private constant [16 x i8] c"\0FUSER:FLOATARR:e" +@res_f.173699F1.0 = private constant [15 x i8] c"\0EUSER:BOOLARR:f" +@argument_arg_5.E3E8C60E.0 = private constant [6 x i8] c"\05arg_5" +@argument_arg_4.43DB6CC9.0 = private constant [6 x i8] c"\05arg_4" +@argument_arg_3.E6500947.0 = private constant [6 x i8] c"\05arg_3" +@argument_arg_2.32BF8FD7.0 = private constant [6 x i8] c"\05arg_2" +@argument_arg_1.12764F87.0 = private constant [6 x i8] c"\05arg_1" +@argument_arg_0.0A040DE9.0 = private constant [6 x i8] c"\05arg_0" + +define { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %0, double %1, i1 %2, { ptr, ptr, i64 } %3, { ptr, ptr, i64 } %4, { ptr, ptr, i64 } %5) local_unnamed_addr !dbg !4 { +alloca_block: + %.fca.0.extract161 = extractvalue { ptr, ptr, i64 } %3, 0 + %.fca.1.extract163 = extractvalue { ptr, ptr, i64 } %3, 1 + %.fca.2.extract165 = extractvalue { ptr, ptr, i64 } %3, 2 + %.fca.0.extract155 = extractvalue { ptr, ptr, i64 } %4, 0 + %.fca.1.extract157 = extractvalue { ptr, ptr, i64 } %4, 1 + %.fca.2.extract159 = extractvalue { ptr, ptr, i64 } %4, 2 + %.fca.0.extract149 = extractvalue { ptr, ptr, i64 } %5, 0 + %.fca.1.extract151 = extractvalue { ptr, ptr, i64 } %5, 1 + %.fca.2.extract153 = extractvalue { ptr, ptr, i64 } %5, 2 + %6 = lshr i64 %.fca.2.extract153, 6, !dbg !16 + %7 = getelementptr i64, ptr %.fca.1.extract151, i64 %6, !dbg !16 + %8 = load i64, ptr %7, align 4, !dbg !16 + %9 = and i64 %.fca.2.extract153, 63, !dbg !16 + %10 = shl nsw i64 -1, %9, !dbg !16 + %11 = and i64 %8, %10, !dbg !16 + store i64 %11, ptr %7, align 4, !dbg !16 + %last_valid.i = add i64 %.fca.2.extract153, 7, !dbg !16 + %12 = lshr i64 %last_valid.i, 6, !dbg !16 + %13 = getelementptr inbounds nuw i64, ptr %.fca.1.extract151, i64 %12, !dbg !16 + %14 = load i64, ptr %13, align 4, !dbg !16 + %15 = and i64 %last_valid.i, 63, !dbg !16 + %16 = xor i64 %15, 63, !dbg !16 + %17 = lshr i64 -1, %16, !dbg !16 + %18 = and i64 %14, %17, !dbg !16 + store i64 %18, ptr %13, align 4, !dbg !16 + %reass.sub.i = sub nsw i64 %12, %6, !dbg !16 + %.not.i = icmp eq i64 %reass.sub.i, -1, !dbg !16 + br i1 %.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +19: ; preds = %mask_block_ok.i + %20 = add nuw i64 %.02.i, 1, !dbg !16 + %exitcond.not.i = icmp eq i64 %.02.i, %reass.sub.i, !dbg !16 + br i1 %exitcond.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +mask_block_ok.i: ; preds = %alloca_block, %19 + %.02.i = phi i64 [ %20, %19 ], [ 0, %alloca_block ], !dbg !18 + %gep.i = getelementptr i64, ptr %7, i64 %.02.i, !dbg !16 + %21 = load i64, ptr %gep.i, align 4, !dbg !16 + %22 = icmp eq i64 %21, 0, !dbg !16 + br i1 %22, label %19, label %mask_block_err.i, !dbg !16 + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !16 + unreachable, !dbg !16 + +__barray_check_none_borrowed.exit: ; preds = %19, %alloca_block + %23 = tail call ptr @heap_alloc(i64 8), !dbg !18 + %24 = tail call ptr @heap_alloc(i64 8), !dbg !18 + store i64 0, ptr %24, align 1, !dbg !18 + %25 = getelementptr inbounds i1, ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %26 = load i64, ptr %25, align 1, !dbg !18 + store i64 %26, ptr %23, align 1, !dbg !18 + %27 = load i64, ptr %7, align 4, !dbg !19 + %28 = and i64 %27, %10, !dbg !19 + store i64 %28, ptr %7, align 4, !dbg !19 + %29 = load i64, ptr %13, align 4, !dbg !19 + %30 = and i64 %29, %17, !dbg !19 + store i64 %30, ptr %13, align 4, !dbg !19 + br i1 %.not.i, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +31: ; preds = %mask_block_ok.i183 + %32 = add nuw i64 %.02.i184, 1, !dbg !19 + %exitcond.not.i187 = icmp eq i64 %.02.i184, %reass.sub.i, !dbg !19 + br i1 %exitcond.not.i187, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +mask_block_ok.i183: ; preds = %__barray_check_none_borrowed.exit, %31 + %.02.i184 = phi i64 [ %32, %31 ], [ 0, %__barray_check_none_borrowed.exit ], !dbg !18 + %gep.i185 = getelementptr i64, ptr %7, i64 %.02.i184, !dbg !19 + %33 = load i64, ptr %gep.i185, align 4, !dbg !19 + %34 = icmp eq i64 %33, 0, !dbg !19 + br i1 %34, label %31, label %mask_block_err.i186, !dbg !19 + +mask_block_err.i186: ; preds = %mask_block_ok.i183 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !19 + unreachable, !dbg !19 + +__barray_check_none_borrowed.exit188: ; preds = %31, %__barray_check_none_borrowed.exit + %35 = lshr i64 %.fca.2.extract159, 6, !dbg !21 + %36 = getelementptr i64, ptr %.fca.1.extract157, i64 %35, !dbg !21 + %37 = load i64, ptr %36, align 4, !dbg !21 + %38 = and i64 %.fca.2.extract159, 63, !dbg !21 + %39 = shl nsw i64 -1, %38, !dbg !21 + %40 = and i64 %37, %39, !dbg !21 + store i64 %40, ptr %36, align 4, !dbg !21 + %last_valid.i189 = add i64 %.fca.2.extract159, 2, !dbg !21 + %41 = lshr i64 %last_valid.i189, 6, !dbg !21 + %42 = getelementptr inbounds nuw i64, ptr %.fca.1.extract157, i64 %41, !dbg !21 + %43 = load i64, ptr %42, align 4, !dbg !21 + %44 = and i64 %last_valid.i189, 63, !dbg !21 + %45 = xor i64 %44, 63, !dbg !21 + %46 = lshr i64 -1, %45, !dbg !21 + %47 = and i64 %43, %46, !dbg !21 + store i64 %47, ptr %42, align 4, !dbg !21 + %reass.sub.i190 = sub nsw i64 %41, %35, !dbg !21 + %.not.i191 = icmp eq i64 %reass.sub.i190, -1, !dbg !21 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +48: ; preds = %mask_block_ok.i192 + %49 = add nuw i64 %.02.i193, 1, !dbg !21 + %exitcond.not.i196 = icmp eq i64 %.02.i193, %reass.sub.i190, !dbg !21 + br i1 %exitcond.not.i196, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +mask_block_ok.i192: ; preds = %__barray_check_none_borrowed.exit188, %48 + %.02.i193 = phi i64 [ %49, %48 ], [ 0, %__barray_check_none_borrowed.exit188 ], !dbg !23 + %gep.i194 = getelementptr i64, ptr %36, i64 %.02.i193, !dbg !21 + %50 = load i64, ptr %gep.i194, align 4, !dbg !21 + %51 = icmp eq i64 %50, 0, !dbg !21 + br i1 %51, label %48, label %mask_block_err.i195, !dbg !21 + +mask_block_err.i195: ; preds = %mask_block_ok.i192 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !21 + unreachable, !dbg !21 + +__barray_check_none_borrowed.exit197: ; preds = %48, %__barray_check_none_borrowed.exit188 + %52 = tail call ptr @heap_alloc(i64 24), !dbg !23 + %53 = tail call ptr @heap_alloc(i64 8), !dbg !23 + store i64 0, ptr %53, align 1, !dbg !23 + %54 = getelementptr inbounds double, ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(24) %52, ptr noundef nonnull align 1 dereferenceable(24) %54, i64 24, i1 false), !dbg !23 + %55 = load i64, ptr %36, align 4, !dbg !24 + %56 = and i64 %55, %39, !dbg !24 + store i64 %56, ptr %36, align 4, !dbg !24 + %57 = load i64, ptr %42, align 4, !dbg !24 + %58 = and i64 %57, %46, !dbg !24 + store i64 %58, ptr %42, align 4, !dbg !24 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +59: ; preds = %mask_block_ok.i201 + %60 = add nuw i64 %.02.i202, 1, !dbg !24 + %exitcond.not.i205 = icmp eq i64 %.02.i202, %reass.sub.i190, !dbg !24 + br i1 %exitcond.not.i205, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +mask_block_ok.i201: ; preds = %__barray_check_none_borrowed.exit197, %59 + %.02.i202 = phi i64 [ %60, %59 ], [ 0, %__barray_check_none_borrowed.exit197 ], !dbg !23 + %gep.i203 = getelementptr i64, ptr %36, i64 %.02.i202, !dbg !24 + %61 = load i64, ptr %gep.i203, align 4, !dbg !24 + %62 = icmp eq i64 %61, 0, !dbg !24 + br i1 %62, label %59, label %mask_block_err.i204, !dbg !24 + +mask_block_err.i204: ; preds = %mask_block_ok.i201 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !24 + unreachable, !dbg !24 + +__barray_check_none_borrowed.exit206: ; preds = %59, %__barray_check_none_borrowed.exit197 + %63 = lshr i64 %.fca.2.extract165, 6, !dbg !26 + %64 = getelementptr i64, ptr %.fca.1.extract163, i64 %63, !dbg !26 + %65 = load i64, ptr %64, align 4, !dbg !26 + %66 = and i64 %.fca.2.extract165, 63, !dbg !26 + %67 = shl nsw i64 -1, %66, !dbg !26 + %68 = and i64 %65, %67, !dbg !26 + store i64 %68, ptr %64, align 4, !dbg !26 + %last_valid.i207 = add i64 %.fca.2.extract165, 4, !dbg !26 + %69 = lshr i64 %last_valid.i207, 6, !dbg !26 + %70 = getelementptr inbounds nuw i64, ptr %.fca.1.extract163, i64 %69, !dbg !26 + %71 = load i64, ptr %70, align 4, !dbg !26 + %72 = and i64 %last_valid.i207, 63, !dbg !26 + %73 = xor i64 %72, 63, !dbg !26 + %74 = lshr i64 -1, %73, !dbg !26 + %75 = and i64 %71, %74, !dbg !26 + store i64 %75, ptr %70, align 4, !dbg !26 + %reass.sub.i208 = sub nsw i64 %69, %63, !dbg !26 + %.not.i209 = icmp eq i64 %reass.sub.i208, -1, !dbg !26 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +76: ; preds = %mask_block_ok.i210 + %77 = add nuw i64 %.02.i211, 1, !dbg !26 + %exitcond.not.i214 = icmp eq i64 %.02.i211, %reass.sub.i208, !dbg !26 + br i1 %exitcond.not.i214, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +mask_block_ok.i210: ; preds = %__barray_check_none_borrowed.exit206, %76 + %.02.i211 = phi i64 [ %77, %76 ], [ 0, %__barray_check_none_borrowed.exit206 ], !dbg !28 + %gep.i212 = getelementptr i64, ptr %64, i64 %.02.i211, !dbg !26 + %78 = load i64, ptr %gep.i212, align 4, !dbg !26 + %79 = icmp eq i64 %78, 0, !dbg !26 + br i1 %79, label %76, label %mask_block_err.i213, !dbg !26 + +mask_block_err.i213: ; preds = %mask_block_ok.i210 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !26 + unreachable, !dbg !26 + +__barray_check_none_borrowed.exit215: ; preds = %76, %__barray_check_none_borrowed.exit206 + %80 = tail call ptr @heap_alloc(i64 40), !dbg !28 + %81 = tail call ptr @heap_alloc(i64 8), !dbg !28 + store i64 0, ptr %81, align 1, !dbg !28 + %82 = getelementptr inbounds i64, ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(40) %80, ptr noundef nonnull align 1 dereferenceable(40) %82, i64 40, i1 false), !dbg !28 + %83 = load i64, ptr %64, align 4, !dbg !29 + %84 = and i64 %83, %67, !dbg !29 + store i64 %84, ptr %64, align 4, !dbg !29 + %85 = load i64, ptr %70, align 4, !dbg !29 + %86 = and i64 %85, %74, !dbg !29 + store i64 %86, ptr %70, align 4, !dbg !29 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +87: ; preds = %mask_block_ok.i219 + %88 = add nuw i64 %.02.i220, 1, !dbg !29 + %exitcond.not.i223 = icmp eq i64 %.02.i220, %reass.sub.i208, !dbg !29 + br i1 %exitcond.not.i223, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +mask_block_ok.i219: ; preds = %__barray_check_none_borrowed.exit215, %87 + %.02.i220 = phi i64 [ %88, %87 ], [ 0, %__barray_check_none_borrowed.exit215 ], !dbg !28 + %gep.i221 = getelementptr i64, ptr %64, i64 %.02.i220, !dbg !29 + %89 = load i64, ptr %gep.i221, align 4, !dbg !29 + %90 = icmp eq i64 %89, 0, !dbg !29 + br i1 %90, label %87, label %mask_block_err.i222, !dbg !29 + +mask_block_err.i222: ; preds = %mask_block_ok.i219 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !29 + unreachable, !dbg !29 + +__barray_check_none_borrowed.exit224: ; preds = %87, %__barray_check_none_borrowed.exit215 + %91 = insertvalue { ptr, ptr, i64 } poison, ptr %80, 0, !dbg !28 + %92 = insertvalue { ptr, ptr, i64 } %91, ptr %81, 1, !dbg !28 + %93 = insertvalue { ptr, ptr, i64 } %92, i64 0, 2, !dbg !28 + %94 = insertvalue { ptr, ptr, i64 } poison, ptr %52, 0, !dbg !23 + %95 = insertvalue { ptr, ptr, i64 } %94, ptr %53, 1, !dbg !23 + %96 = insertvalue { ptr, ptr, i64 } %95, i64 0, 2, !dbg !23 + %97 = insertvalue { ptr, ptr, i64 } poison, ptr %23, 0, !dbg !18 + %98 = insertvalue { ptr, ptr, i64 } %97, ptr %24, 1, !dbg !18 + %99 = insertvalue { ptr, ptr, i64 } %98, i64 0, 2, !dbg !18 + tail call void @print_int(ptr nonnull @res_a.19FB4E83.0, i64 10, i64 %0), !dbg !31 + tail call void @print_float(ptr nonnull @res_b.0E048F9C.0, i64 12, double %1), !dbg !32 + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %2), !dbg !33 + %100 = getelementptr inbounds [5 x i64], ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !28 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4, !dbg !28 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8, !dbg !28 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16, !dbg !28 + %101 = alloca [5 x i1], align 1, !dbg !28 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %101, i8 0, i64 5, i1 false), !dbg !28 + store i32 5, ptr %out_arr_alloca, align 8, !dbg !28 + store i32 1, ptr %y_ptr, align 4, !dbg !28 + store ptr %100, ptr %arr_ptr, align 8, !dbg !28 + store ptr %101, ptr %mask_ptr, align 8, !dbg !28 + call void @print_int_arr(ptr nonnull @res_d.93EDD03A.0, i64 13, ptr nonnull %out_arr_alloca), !dbg !28 + %102 = getelementptr inbounds [3 x double], ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + %out_arr_alloca57 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !23 + %y_ptr59 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 4, !dbg !23 + %arr_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 8, !dbg !23 + %mask_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 16, !dbg !23 + %103 = alloca [3 x i1], align 1, !dbg !23 + store i1 false, ptr %103, align 1, !dbg !23 + %.repack171 = getelementptr inbounds nuw i8, ptr %103, i64 1, !dbg !23 + store i1 false, ptr %.repack171, align 1, !dbg !23 + %.repack172 = getelementptr inbounds nuw i8, ptr %103, i64 2, !dbg !23 + store i1 false, ptr %.repack172, align 1, !dbg !23 + store i32 3, ptr %out_arr_alloca57, align 8, !dbg !23 + store i32 1, ptr %y_ptr59, align 4, !dbg !23 + store ptr %102, ptr %arr_ptr60, align 8, !dbg !23 + store ptr %103, ptr %mask_ptr61, align 8, !dbg !23 + call void @print_float_arr(ptr nonnull @res_e.DB2DB1D9.0, i64 15, ptr nonnull %out_arr_alloca57), !dbg !23 + %104 = getelementptr inbounds [8 x i1], ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %out_arr_alloca67 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !18 + %y_ptr69 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 4, !dbg !18 + %arr_ptr70 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 8, !dbg !18 + %mask_ptr71 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 16, !dbg !18 + %105 = alloca [8 x i1], align 8, !dbg !18 + store i64 0, ptr %105, align 8, !dbg !18 + store i32 8, ptr %out_arr_alloca67, align 8, !dbg !18 + store i32 1, ptr %y_ptr69, align 4, !dbg !18 + store ptr %104, ptr %arr_ptr70, align 8, !dbg !18 + store ptr %105, ptr %mask_ptr71, align 8, !dbg !18 + call void @print_bool_arr(ptr nonnull @res_f.173699F1.0, i64 14, ptr nonnull %out_arr_alloca67), !dbg !18 + %mrv = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } poison, { ptr, ptr, i64 } %93, 0 + %mrv89 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv, { ptr, ptr, i64 } %96, 1 + %mrv90 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv89, { ptr, ptr, i64 } %99, 2 + ret { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv90 +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #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 @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_float(ptr, i64, double) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) 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 @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @argreader_get_bool_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_f64_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_i64_array(ptr, ptr, i64) local_unnamed_addr + +declare i1 @argreader_get_bool(ptr) local_unnamed_addr + +declare double @argreader_get_f64(ptr) local_unnamed_addr + +declare i64 @argreader_get_i64(ptr) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !34 { +entry: + tail call void @setup(i64 %0), !dbg !38 + %1 = tail call ptr @heap_alloc(i64 8), !dbg !38 + %2 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %2, align 1, !dbg !38 + %3 = insertvalue { ptr, ptr, i64 } poison, ptr %1, 0, !dbg !38 + %4 = insertvalue { ptr, ptr, i64 } %3, ptr %2, 1, !dbg !38 + %5 = insertvalue { ptr, ptr, i64 } %4, i64 0, 2, !dbg !38 + tail call void @argreader_get_bool_array(ptr nonnull @argument_arg_5.E3E8C60E.0, ptr %1, i64 8), !dbg !38 + %6 = tail call ptr @heap_alloc(i64 24), !dbg !38 + %7 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %7, align 1, !dbg !38 + %8 = insertvalue { ptr, ptr, i64 } poison, ptr %6, 0, !dbg !38 + %9 = insertvalue { ptr, ptr, i64 } %8, ptr %7, 1, !dbg !38 + %10 = insertvalue { ptr, ptr, i64 } %9, i64 0, 2, !dbg !38 + tail call void @argreader_get_f64_array(ptr nonnull @argument_arg_4.43DB6CC9.0, ptr %6, i64 3), !dbg !38 + %11 = tail call ptr @heap_alloc(i64 40), !dbg !38 + %12 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %12, align 1, !dbg !38 + %13 = insertvalue { ptr, ptr, i64 } poison, ptr %11, 0, !dbg !38 + %14 = insertvalue { ptr, ptr, i64 } %13, ptr %12, 1, !dbg !38 + %15 = insertvalue { ptr, ptr, i64 } %14, i64 0, 2, !dbg !38 + tail call void @argreader_get_i64_array(ptr nonnull @argument_arg_3.E6500947.0, ptr %11, i64 5), !dbg !38 + %read_arg_bool.i = tail call i1 @argreader_get_bool(ptr nonnull @argument_arg_2.32BF8FD7.0), !dbg !38 + %read_arg_f64.i = tail call double @argreader_get_f64(ptr nonnull @argument_arg_1.12764F87.0), !dbg !38 + %read_arg_int.i = tail call i64 @argreader_get_i64(ptr nonnull @argument_arg_0.0A040DE9.0), !dbg !38 + %16 = tail call { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %read_arg_int.i, double %read_arg_f64.i, i1 %read_arg_bool.i, { ptr, ptr, i64 } %15, { ptr, ptr, i64 } %10, { ptr, ptr, i64 } %5), !dbg !38 + %17 = tail call i64 @teardown(), !dbg !38 + ret i64 %17, !dbg !38 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } +attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } + +!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.0-a3)-v1.0.0-a3", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "entry_args..foo", linkageName: "__hugr__.__main__.entry_args..foo.1", scope: null, file: !5, line: 247, type: !6, scopeLine: 248, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!6 = !DISubroutineType(types: !7) +!7 = !{!8, !13, !14, !15, !10, !10, !10} +!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } }", file: !2, size: 576, align: 8, elements: !9) +!9 = !{!10, !10, !10} +!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !11) +!11 = !{!12, !12, !13} +!12 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DIBasicType(name: "f64", size: 64, encoding: DW_ATE_float) +!15 = !DIBasicType(name: "i1", size: 1, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !17) +!17 = distinct !DILocation(line: 253, column: 8, scope: !4) +!18 = !DILocation(line: 253, column: 8, scope: !4) +!19 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !20) +!20 = distinct !DILocation(line: 253, column: 8, scope: !4) +!21 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !22) +!22 = distinct !DILocation(line: 252, column: 8, scope: !4) +!23 = !DILocation(line: 252, column: 8, scope: !4) +!24 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !25) +!25 = distinct !DILocation(line: 252, column: 8, scope: !4) +!26 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !27) +!27 = distinct !DILocation(line: 251, column: 8, scope: !4) +!28 = !DILocation(line: 251, column: 8, scope: !4) +!29 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !30) +!30 = distinct !DILocation(line: 251, column: 8, scope: !4) +!31 = !DILocation(line: 248, column: 8, scope: !4) +!32 = !DILocation(line: 249, column: 8, scope: !4) +!33 = !DILocation(line: 250, column: 8, scope: !4) +!34 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !35, type: !36, spFlags: DISPFlagDefinition, unit: !1) +!35 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!36 = !DISubroutineType(types: !37) +!37 = !{!13, !13} +!38 = !DILocation(line: 0, scope: !34) \ No newline at end of file diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios index e3dde7f24..56abacfc8 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37, !dbg !10 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41, !dbg !11 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45, !dbg !13 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios index 12ae80e96..72b83c3fa 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios @@ -15,9 +15,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i - %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6, !dbg !72 - %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136, !dbg !72 +cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i + %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6, !dbg !72 + %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136, !dbg !72 %138 = load i64, ptr %137, align 4, !dbg !72 - %139 = and i64 %"421_1.sroa.10.0.i.i", 63, !dbg !72 + %139 = and i64 %"425_1.sroa.10.0.i.i", 63, !dbg !72 %140 = sub nuw nsw i64 64, %139, !dbg !72 %141 = lshr i64 -1, %140, !dbg !72 %142 = icmp eq i64 %139, 0, !dbg !72 %143 = select i1 %142, i64 0, i64 %141, !dbg !72 %144 = or i64 %138, %143, !dbg !72 store i64 %144, ptr %137, align 4, !dbg !72 - %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9, !dbg !72 + %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9, !dbg !72 %145 = lshr i64 %last_valid.i.i.i179, 6, !dbg !72 - %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145, !dbg !72 + %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145, !dbg !72 %147 = load i64, ptr %146, align 4, !dbg !72 %148 = and i64 %last_valid.i.i.i179, 63, !dbg !72 %149 = shl nsw i64 -2, %148, !dbg !72 @@ -474,8 +474,8 @@ cond_424_case_0.i.i: ; preds = %cond_exit_424.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180, !dbg !72 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182, !dbg !72 -mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183, !dbg !72 %155 = load i64, ptr %gep.i.i.i184, align 4, !dbg !72 %156 = icmp eq i64 %155, -1, !dbg !72 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0"), !dbg !72 unreachable, !dbg !72 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i - %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] - %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 - %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i + %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] + %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 + %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %165, %161, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios index 26ae88fe9..099221a73 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit, !dbg !8 -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios index 1654bc2a4..cd590beab 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit, !dbg !8 -cond_44_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"), !dbg !8 unreachable, !dbg !8 -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios index ea80cf39a..5e3a359ed 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit, !dbg !8 -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.38.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.42.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios index 60e63f416..f17bfa910 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 + %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios index 42e033623..45b6fab53 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit, !dbg !8 -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] +__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i, !dbg !15 -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios index e589051cc..25f3acf19 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios @@ -14,9 +14,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_225_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_229_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-entry_args/entry_args_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-entry_args/entry_args_x86_64-windows-msvc_helios new file mode 100644 index 000000000..c4e37933b --- /dev/null +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-entry_args/entry_args_x86_64-windows-msvc_helios @@ -0,0 +1,408 @@ +; 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-msvc" + +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_a.19FB4E83.0 = private constant [11 x i8] c"\0AUSER:INT:a" +@res_b.0E048F9C.0 = private constant [13 x i8] c"\0CUSER:FLOAT:b" +@res_c.1C9EF4D1.0 = private constant [12 x i8] c"\0BUSER:BOOL:c" +@res_d.93EDD03A.0 = private constant [14 x i8] c"\0DUSER:INTARR:d" +@res_e.DB2DB1D9.0 = private constant [16 x i8] c"\0FUSER:FLOATARR:e" +@res_f.173699F1.0 = private constant [15 x i8] c"\0EUSER:BOOLARR:f" +@argument_arg_5.E3E8C60E.0 = private constant [6 x i8] c"\05arg_5" +@argument_arg_4.43DB6CC9.0 = private constant [6 x i8] c"\05arg_4" +@argument_arg_3.E6500947.0 = private constant [6 x i8] c"\05arg_3" +@argument_arg_2.32BF8FD7.0 = private constant [6 x i8] c"\05arg_2" +@argument_arg_1.12764F87.0 = private constant [6 x i8] c"\05arg_1" +@argument_arg_0.0A040DE9.0 = private constant [6 x i8] c"\05arg_0" + +define { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %0, double %1, i1 %2, { ptr, ptr, i64 } %3, { ptr, ptr, i64 } %4, { ptr, ptr, i64 } %5) local_unnamed_addr !dbg !4 { +alloca_block: + %.fca.0.extract161 = extractvalue { ptr, ptr, i64 } %3, 0 + %.fca.1.extract163 = extractvalue { ptr, ptr, i64 } %3, 1 + %.fca.2.extract165 = extractvalue { ptr, ptr, i64 } %3, 2 + %.fca.0.extract155 = extractvalue { ptr, ptr, i64 } %4, 0 + %.fca.1.extract157 = extractvalue { ptr, ptr, i64 } %4, 1 + %.fca.2.extract159 = extractvalue { ptr, ptr, i64 } %4, 2 + %.fca.0.extract149 = extractvalue { ptr, ptr, i64 } %5, 0 + %.fca.1.extract151 = extractvalue { ptr, ptr, i64 } %5, 1 + %.fca.2.extract153 = extractvalue { ptr, ptr, i64 } %5, 2 + %6 = lshr i64 %.fca.2.extract153, 6, !dbg !16 + %7 = getelementptr i64, ptr %.fca.1.extract151, i64 %6, !dbg !16 + %8 = load i64, ptr %7, align 4, !dbg !16 + %9 = and i64 %.fca.2.extract153, 63, !dbg !16 + %10 = shl nsw i64 -1, %9, !dbg !16 + %11 = and i64 %8, %10, !dbg !16 + store i64 %11, ptr %7, align 4, !dbg !16 + %last_valid.i = add i64 %.fca.2.extract153, 7, !dbg !16 + %12 = lshr i64 %last_valid.i, 6, !dbg !16 + %13 = getelementptr inbounds nuw i64, ptr %.fca.1.extract151, i64 %12, !dbg !16 + %14 = load i64, ptr %13, align 4, !dbg !16 + %15 = and i64 %last_valid.i, 63, !dbg !16 + %16 = xor i64 %15, 63, !dbg !16 + %17 = lshr i64 -1, %16, !dbg !16 + %18 = and i64 %14, %17, !dbg !16 + store i64 %18, ptr %13, align 4, !dbg !16 + %reass.sub.i = sub nsw i64 %12, %6, !dbg !16 + %.not.i = icmp eq i64 %reass.sub.i, -1, !dbg !16 + br i1 %.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +19: ; preds = %mask_block_ok.i + %20 = add nuw i64 %.02.i, 1, !dbg !16 + %exitcond.not.i = icmp eq i64 %.02.i, %reass.sub.i, !dbg !16 + br i1 %exitcond.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +mask_block_ok.i: ; preds = %alloca_block, %19 + %.02.i = phi i64 [ %20, %19 ], [ 0, %alloca_block ], !dbg !18 + %gep.i = getelementptr i64, ptr %7, i64 %.02.i, !dbg !16 + %21 = load i64, ptr %gep.i, align 4, !dbg !16 + %22 = icmp eq i64 %21, 0, !dbg !16 + br i1 %22, label %19, label %mask_block_err.i, !dbg !16 + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !16 + unreachable, !dbg !16 + +__barray_check_none_borrowed.exit: ; preds = %19, %alloca_block + %23 = tail call ptr @heap_alloc(i64 8), !dbg !18 + %24 = tail call ptr @heap_alloc(i64 8), !dbg !18 + store i64 0, ptr %24, align 1, !dbg !18 + %25 = getelementptr inbounds i1, ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %26 = load i64, ptr %25, align 1, !dbg !18 + store i64 %26, ptr %23, align 1, !dbg !18 + %27 = load i64, ptr %7, align 4, !dbg !19 + %28 = and i64 %27, %10, !dbg !19 + store i64 %28, ptr %7, align 4, !dbg !19 + %29 = load i64, ptr %13, align 4, !dbg !19 + %30 = and i64 %29, %17, !dbg !19 + store i64 %30, ptr %13, align 4, !dbg !19 + br i1 %.not.i, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +31: ; preds = %mask_block_ok.i183 + %32 = add nuw i64 %.02.i184, 1, !dbg !19 + %exitcond.not.i187 = icmp eq i64 %.02.i184, %reass.sub.i, !dbg !19 + br i1 %exitcond.not.i187, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +mask_block_ok.i183: ; preds = %__barray_check_none_borrowed.exit, %31 + %.02.i184 = phi i64 [ %32, %31 ], [ 0, %__barray_check_none_borrowed.exit ], !dbg !18 + %gep.i185 = getelementptr i64, ptr %7, i64 %.02.i184, !dbg !19 + %33 = load i64, ptr %gep.i185, align 4, !dbg !19 + %34 = icmp eq i64 %33, 0, !dbg !19 + br i1 %34, label %31, label %mask_block_err.i186, !dbg !19 + +mask_block_err.i186: ; preds = %mask_block_ok.i183 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !19 + unreachable, !dbg !19 + +__barray_check_none_borrowed.exit188: ; preds = %31, %__barray_check_none_borrowed.exit + %35 = lshr i64 %.fca.2.extract159, 6, !dbg !21 + %36 = getelementptr i64, ptr %.fca.1.extract157, i64 %35, !dbg !21 + %37 = load i64, ptr %36, align 4, !dbg !21 + %38 = and i64 %.fca.2.extract159, 63, !dbg !21 + %39 = shl nsw i64 -1, %38, !dbg !21 + %40 = and i64 %37, %39, !dbg !21 + store i64 %40, ptr %36, align 4, !dbg !21 + %last_valid.i189 = add i64 %.fca.2.extract159, 2, !dbg !21 + %41 = lshr i64 %last_valid.i189, 6, !dbg !21 + %42 = getelementptr inbounds nuw i64, ptr %.fca.1.extract157, i64 %41, !dbg !21 + %43 = load i64, ptr %42, align 4, !dbg !21 + %44 = and i64 %last_valid.i189, 63, !dbg !21 + %45 = xor i64 %44, 63, !dbg !21 + %46 = lshr i64 -1, %45, !dbg !21 + %47 = and i64 %43, %46, !dbg !21 + store i64 %47, ptr %42, align 4, !dbg !21 + %reass.sub.i190 = sub nsw i64 %41, %35, !dbg !21 + %.not.i191 = icmp eq i64 %reass.sub.i190, -1, !dbg !21 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +48: ; preds = %mask_block_ok.i192 + %49 = add nuw i64 %.02.i193, 1, !dbg !21 + %exitcond.not.i196 = icmp eq i64 %.02.i193, %reass.sub.i190, !dbg !21 + br i1 %exitcond.not.i196, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +mask_block_ok.i192: ; preds = %__barray_check_none_borrowed.exit188, %48 + %.02.i193 = phi i64 [ %49, %48 ], [ 0, %__barray_check_none_borrowed.exit188 ], !dbg !23 + %gep.i194 = getelementptr i64, ptr %36, i64 %.02.i193, !dbg !21 + %50 = load i64, ptr %gep.i194, align 4, !dbg !21 + %51 = icmp eq i64 %50, 0, !dbg !21 + br i1 %51, label %48, label %mask_block_err.i195, !dbg !21 + +mask_block_err.i195: ; preds = %mask_block_ok.i192 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !21 + unreachable, !dbg !21 + +__barray_check_none_borrowed.exit197: ; preds = %48, %__barray_check_none_borrowed.exit188 + %52 = tail call ptr @heap_alloc(i64 24), !dbg !23 + %53 = tail call ptr @heap_alloc(i64 8), !dbg !23 + store i64 0, ptr %53, align 1, !dbg !23 + %54 = getelementptr inbounds double, ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(24) %52, ptr noundef nonnull align 1 dereferenceable(24) %54, i64 24, i1 false), !dbg !23 + %55 = load i64, ptr %36, align 4, !dbg !24 + %56 = and i64 %55, %39, !dbg !24 + store i64 %56, ptr %36, align 4, !dbg !24 + %57 = load i64, ptr %42, align 4, !dbg !24 + %58 = and i64 %57, %46, !dbg !24 + store i64 %58, ptr %42, align 4, !dbg !24 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +59: ; preds = %mask_block_ok.i201 + %60 = add nuw i64 %.02.i202, 1, !dbg !24 + %exitcond.not.i205 = icmp eq i64 %.02.i202, %reass.sub.i190, !dbg !24 + br i1 %exitcond.not.i205, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +mask_block_ok.i201: ; preds = %__barray_check_none_borrowed.exit197, %59 + %.02.i202 = phi i64 [ %60, %59 ], [ 0, %__barray_check_none_borrowed.exit197 ], !dbg !23 + %gep.i203 = getelementptr i64, ptr %36, i64 %.02.i202, !dbg !24 + %61 = load i64, ptr %gep.i203, align 4, !dbg !24 + %62 = icmp eq i64 %61, 0, !dbg !24 + br i1 %62, label %59, label %mask_block_err.i204, !dbg !24 + +mask_block_err.i204: ; preds = %mask_block_ok.i201 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !24 + unreachable, !dbg !24 + +__barray_check_none_borrowed.exit206: ; preds = %59, %__barray_check_none_borrowed.exit197 + %63 = lshr i64 %.fca.2.extract165, 6, !dbg !26 + %64 = getelementptr i64, ptr %.fca.1.extract163, i64 %63, !dbg !26 + %65 = load i64, ptr %64, align 4, !dbg !26 + %66 = and i64 %.fca.2.extract165, 63, !dbg !26 + %67 = shl nsw i64 -1, %66, !dbg !26 + %68 = and i64 %65, %67, !dbg !26 + store i64 %68, ptr %64, align 4, !dbg !26 + %last_valid.i207 = add i64 %.fca.2.extract165, 4, !dbg !26 + %69 = lshr i64 %last_valid.i207, 6, !dbg !26 + %70 = getelementptr inbounds nuw i64, ptr %.fca.1.extract163, i64 %69, !dbg !26 + %71 = load i64, ptr %70, align 4, !dbg !26 + %72 = and i64 %last_valid.i207, 63, !dbg !26 + %73 = xor i64 %72, 63, !dbg !26 + %74 = lshr i64 -1, %73, !dbg !26 + %75 = and i64 %71, %74, !dbg !26 + store i64 %75, ptr %70, align 4, !dbg !26 + %reass.sub.i208 = sub nsw i64 %69, %63, !dbg !26 + %.not.i209 = icmp eq i64 %reass.sub.i208, -1, !dbg !26 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +76: ; preds = %mask_block_ok.i210 + %77 = add nuw i64 %.02.i211, 1, !dbg !26 + %exitcond.not.i214 = icmp eq i64 %.02.i211, %reass.sub.i208, !dbg !26 + br i1 %exitcond.not.i214, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +mask_block_ok.i210: ; preds = %__barray_check_none_borrowed.exit206, %76 + %.02.i211 = phi i64 [ %77, %76 ], [ 0, %__barray_check_none_borrowed.exit206 ], !dbg !28 + %gep.i212 = getelementptr i64, ptr %64, i64 %.02.i211, !dbg !26 + %78 = load i64, ptr %gep.i212, align 4, !dbg !26 + %79 = icmp eq i64 %78, 0, !dbg !26 + br i1 %79, label %76, label %mask_block_err.i213, !dbg !26 + +mask_block_err.i213: ; preds = %mask_block_ok.i210 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !26 + unreachable, !dbg !26 + +__barray_check_none_borrowed.exit215: ; preds = %76, %__barray_check_none_borrowed.exit206 + %80 = tail call ptr @heap_alloc(i64 40), !dbg !28 + %81 = tail call ptr @heap_alloc(i64 8), !dbg !28 + store i64 0, ptr %81, align 1, !dbg !28 + %82 = getelementptr inbounds i64, ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(40) %80, ptr noundef nonnull align 1 dereferenceable(40) %82, i64 40, i1 false), !dbg !28 + %83 = load i64, ptr %64, align 4, !dbg !29 + %84 = and i64 %83, %67, !dbg !29 + store i64 %84, ptr %64, align 4, !dbg !29 + %85 = load i64, ptr %70, align 4, !dbg !29 + %86 = and i64 %85, %74, !dbg !29 + store i64 %86, ptr %70, align 4, !dbg !29 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +87: ; preds = %mask_block_ok.i219 + %88 = add nuw i64 %.02.i220, 1, !dbg !29 + %exitcond.not.i223 = icmp eq i64 %.02.i220, %reass.sub.i208, !dbg !29 + br i1 %exitcond.not.i223, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +mask_block_ok.i219: ; preds = %__barray_check_none_borrowed.exit215, %87 + %.02.i220 = phi i64 [ %88, %87 ], [ 0, %__barray_check_none_borrowed.exit215 ], !dbg !28 + %gep.i221 = getelementptr i64, ptr %64, i64 %.02.i220, !dbg !29 + %89 = load i64, ptr %gep.i221, align 4, !dbg !29 + %90 = icmp eq i64 %89, 0, !dbg !29 + br i1 %90, label %87, label %mask_block_err.i222, !dbg !29 + +mask_block_err.i222: ; preds = %mask_block_ok.i219 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !29 + unreachable, !dbg !29 + +__barray_check_none_borrowed.exit224: ; preds = %87, %__barray_check_none_borrowed.exit215 + %91 = insertvalue { ptr, ptr, i64 } poison, ptr %80, 0, !dbg !28 + %92 = insertvalue { ptr, ptr, i64 } %91, ptr %81, 1, !dbg !28 + %93 = insertvalue { ptr, ptr, i64 } %92, i64 0, 2, !dbg !28 + %94 = insertvalue { ptr, ptr, i64 } poison, ptr %52, 0, !dbg !23 + %95 = insertvalue { ptr, ptr, i64 } %94, ptr %53, 1, !dbg !23 + %96 = insertvalue { ptr, ptr, i64 } %95, i64 0, 2, !dbg !23 + %97 = insertvalue { ptr, ptr, i64 } poison, ptr %23, 0, !dbg !18 + %98 = insertvalue { ptr, ptr, i64 } %97, ptr %24, 1, !dbg !18 + %99 = insertvalue { ptr, ptr, i64 } %98, i64 0, 2, !dbg !18 + tail call void @print_int(ptr nonnull @res_a.19FB4E83.0, i64 10, i64 %0), !dbg !31 + tail call void @print_float(ptr nonnull @res_b.0E048F9C.0, i64 12, double %1), !dbg !32 + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %2), !dbg !33 + %100 = getelementptr inbounds [5 x i64], ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !28 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4, !dbg !28 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8, !dbg !28 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16, !dbg !28 + %101 = alloca [5 x i1], align 1, !dbg !28 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %101, i8 0, i64 5, i1 false), !dbg !28 + store i32 5, ptr %out_arr_alloca, align 8, !dbg !28 + store i32 1, ptr %y_ptr, align 4, !dbg !28 + store ptr %100, ptr %arr_ptr, align 8, !dbg !28 + store ptr %101, ptr %mask_ptr, align 8, !dbg !28 + call void @print_int_arr(ptr nonnull @res_d.93EDD03A.0, i64 13, ptr nonnull %out_arr_alloca), !dbg !28 + %102 = getelementptr inbounds [3 x double], ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + %out_arr_alloca57 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !23 + %y_ptr59 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 4, !dbg !23 + %arr_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 8, !dbg !23 + %mask_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 16, !dbg !23 + %103 = alloca [3 x i1], align 1, !dbg !23 + store i1 false, ptr %103, align 1, !dbg !23 + %.repack171 = getelementptr inbounds nuw i8, ptr %103, i64 1, !dbg !23 + store i1 false, ptr %.repack171, align 1, !dbg !23 + %.repack172 = getelementptr inbounds nuw i8, ptr %103, i64 2, !dbg !23 + store i1 false, ptr %.repack172, align 1, !dbg !23 + store i32 3, ptr %out_arr_alloca57, align 8, !dbg !23 + store i32 1, ptr %y_ptr59, align 4, !dbg !23 + store ptr %102, ptr %arr_ptr60, align 8, !dbg !23 + store ptr %103, ptr %mask_ptr61, align 8, !dbg !23 + call void @print_float_arr(ptr nonnull @res_e.DB2DB1D9.0, i64 15, ptr nonnull %out_arr_alloca57), !dbg !23 + %104 = getelementptr inbounds [8 x i1], ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %out_arr_alloca67 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !18 + %y_ptr69 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 4, !dbg !18 + %arr_ptr70 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 8, !dbg !18 + %mask_ptr71 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 16, !dbg !18 + %105 = alloca [8 x i1], align 8, !dbg !18 + store i64 0, ptr %105, align 8, !dbg !18 + store i32 8, ptr %out_arr_alloca67, align 8, !dbg !18 + store i32 1, ptr %y_ptr69, align 4, !dbg !18 + store ptr %104, ptr %arr_ptr70, align 8, !dbg !18 + store ptr %105, ptr %mask_ptr71, align 8, !dbg !18 + call void @print_bool_arr(ptr nonnull @res_f.173699F1.0, i64 14, ptr nonnull %out_arr_alloca67), !dbg !18 + %mrv = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } poison, { ptr, ptr, i64 } %93, 0 + %mrv89 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv, { ptr, ptr, i64 } %96, 1 + %mrv90 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv89, { ptr, ptr, i64 } %99, 2 + ret { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv90 +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #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 @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_float(ptr, i64, double) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) 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 @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @argreader_get_bool_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_f64_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_i64_array(ptr, ptr, i64) local_unnamed_addr + +declare i1 @argreader_get_bool(ptr) local_unnamed_addr + +declare double @argreader_get_f64(ptr) local_unnamed_addr + +declare i64 @argreader_get_i64(ptr) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !34 { +entry: + tail call void @setup(i64 %0), !dbg !38 + %1 = tail call ptr @heap_alloc(i64 8), !dbg !38 + %2 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %2, align 1, !dbg !38 + %3 = insertvalue { ptr, ptr, i64 } poison, ptr %1, 0, !dbg !38 + %4 = insertvalue { ptr, ptr, i64 } %3, ptr %2, 1, !dbg !38 + %5 = insertvalue { ptr, ptr, i64 } %4, i64 0, 2, !dbg !38 + tail call void @argreader_get_bool_array(ptr nonnull @argument_arg_5.E3E8C60E.0, ptr %1, i64 8), !dbg !38 + %6 = tail call ptr @heap_alloc(i64 24), !dbg !38 + %7 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %7, align 1, !dbg !38 + %8 = insertvalue { ptr, ptr, i64 } poison, ptr %6, 0, !dbg !38 + %9 = insertvalue { ptr, ptr, i64 } %8, ptr %7, 1, !dbg !38 + %10 = insertvalue { ptr, ptr, i64 } %9, i64 0, 2, !dbg !38 + tail call void @argreader_get_f64_array(ptr nonnull @argument_arg_4.43DB6CC9.0, ptr %6, i64 3), !dbg !38 + %11 = tail call ptr @heap_alloc(i64 40), !dbg !38 + %12 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %12, align 1, !dbg !38 + %13 = insertvalue { ptr, ptr, i64 } poison, ptr %11, 0, !dbg !38 + %14 = insertvalue { ptr, ptr, i64 } %13, ptr %12, 1, !dbg !38 + %15 = insertvalue { ptr, ptr, i64 } %14, i64 0, 2, !dbg !38 + tail call void @argreader_get_i64_array(ptr nonnull @argument_arg_3.E6500947.0, ptr %11, i64 5), !dbg !38 + %read_arg_bool.i = tail call i1 @argreader_get_bool(ptr nonnull @argument_arg_2.32BF8FD7.0), !dbg !38 + %read_arg_f64.i = tail call double @argreader_get_f64(ptr nonnull @argument_arg_1.12764F87.0), !dbg !38 + %read_arg_int.i = tail call i64 @argreader_get_i64(ptr nonnull @argument_arg_0.0A040DE9.0), !dbg !38 + %16 = tail call { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %read_arg_int.i, double %read_arg_f64.i, i1 %read_arg_bool.i, { ptr, ptr, i64 } %15, { ptr, ptr, i64 } %10, { ptr, ptr, i64 } %5), !dbg !38 + %17 = tail call i64 @teardown(), !dbg !38 + ret i64 %17, !dbg !38 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } +attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } + +!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.0-a3)-v1.0.0-a3", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "entry_args..foo", linkageName: "__hugr__.__main__.entry_args..foo.1", scope: null, file: !5, line: 247, type: !6, scopeLine: 248, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!6 = !DISubroutineType(types: !7) +!7 = !{!8, !13, !14, !15, !10, !10, !10} +!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } }", file: !2, size: 576, align: 8, elements: !9) +!9 = !{!10, !10, !10} +!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !11) +!11 = !{!12, !12, !13} +!12 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DIBasicType(name: "f64", size: 64, encoding: DW_ATE_float) +!15 = !DIBasicType(name: "i1", size: 1, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !17) +!17 = distinct !DILocation(line: 253, column: 8, scope: !4) +!18 = !DILocation(line: 253, column: 8, scope: !4) +!19 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !20) +!20 = distinct !DILocation(line: 253, column: 8, scope: !4) +!21 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !22) +!22 = distinct !DILocation(line: 252, column: 8, scope: !4) +!23 = !DILocation(line: 252, column: 8, scope: !4) +!24 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !25) +!25 = distinct !DILocation(line: 252, column: 8, scope: !4) +!26 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !27) +!27 = distinct !DILocation(line: 251, column: 8, scope: !4) +!28 = !DILocation(line: 251, column: 8, scope: !4) +!29 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !30) +!30 = distinct !DILocation(line: 251, column: 8, scope: !4) +!31 = !DILocation(line: 248, column: 8, scope: !4) +!32 = !DILocation(line: 249, column: 8, scope: !4) +!33 = !DILocation(line: 250, column: 8, scope: !4) +!34 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !35, type: !36, spFlags: DISPFlagDefinition, unit: !1) +!35 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!36 = !DISubroutineType(types: !37) +!37 = !{!13, !13} +!38 = !DILocation(line: 0, scope: !34) \ No newline at end of file diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios index c5bca889c..39e04e55f 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.36.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37, !dbg !10 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41, !dbg !11 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45, !dbg !13 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios index 0f5128d5b..d727c4bb9 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios @@ -15,9 +15,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i - %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6, !dbg !72 - %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136, !dbg !72 +cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i + %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6, !dbg !72 + %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136, !dbg !72 %138 = load i64, ptr %137, align 4, !dbg !72 - %139 = and i64 %"421_1.sroa.10.0.i.i", 63, !dbg !72 + %139 = and i64 %"425_1.sroa.10.0.i.i", 63, !dbg !72 %140 = sub nuw nsw i64 64, %139, !dbg !72 %141 = lshr i64 -1, %140, !dbg !72 %142 = icmp eq i64 %139, 0, !dbg !72 %143 = select i1 %142, i64 0, i64 %141, !dbg !72 %144 = or i64 %138, %143, !dbg !72 store i64 %144, ptr %137, align 4, !dbg !72 - %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9, !dbg !72 + %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9, !dbg !72 %145 = lshr i64 %last_valid.i.i.i179, 6, !dbg !72 - %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145, !dbg !72 + %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145, !dbg !72 %147 = load i64, ptr %146, align 4, !dbg !72 %148 = and i64 %last_valid.i.i.i179, 63, !dbg !72 %149 = shl nsw i64 -2, %148, !dbg !72 @@ -474,8 +474,8 @@ cond_424_case_0.i.i: ; preds = %cond_exit_424.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180, !dbg !72 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182, !dbg !72 -mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183, !dbg !72 %155 = load i64, ptr %gep.i.i.i184, align 4, !dbg !72 %156 = icmp eq i64 %155, -1, !dbg !72 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0"), !dbg !72 unreachable, !dbg !72 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i - %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] - %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 - %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i + %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] + %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 + %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %165, %161, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios index dc57b8314..3ff249f56 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit, !dbg !8 -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.19.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios index d5c827186..76c108e90 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit, !dbg !8 -cond_44_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"), !dbg !8 unreachable, !dbg !8 -__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios index 43235be56..dc90bf1b5 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit, !dbg !8 -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.38.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.42.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios index 66030e5fd..f20a6c06e 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 + %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios index 472066de2..a68c1836c 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit, !dbg !8 -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] +__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i, !dbg !15 -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol index cf75488ba..73555328d 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol @@ -14,157 +14,157 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit, !dbg !9 -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_sol_qalloc.221.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.225.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !9 %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.9, %__hugr__.__tk2_sol_qalloc.221.exit.8, %__hugr__.__tk2_sol_qalloc.221.exit.7, %__hugr__.__tk2_sol_qalloc.221.exit.6, %__hugr__.__tk2_sol_qalloc.221.exit.5, %__hugr__.__tk2_sol_qalloc.221.exit.4, %__hugr__.__tk2_sol_qalloc.221.exit.3, %__hugr__.__tk2_sol_qalloc.221.exit.2, %__hugr__.__tk2_sol_qalloc.221.exit.1, %__hugr__.__tk2_sol_qalloc.221.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.225.exit.8, %__hugr__.__tk2_sol_qalloc.225.exit.7, %__hugr__.__tk2_sol_qalloc.225.exit.6, %__hugr__.__tk2_sol_qalloc.225.exit.5, %__hugr__.__tk2_sol_qalloc.225.exit.4, %__hugr__.__tk2_sol_qalloc.225.exit.3, %__hugr__.__tk2_sol_qalloc.225.exit.2, %__hugr__.__tk2_sol_qalloc.225.exit.1, %__hugr__.__tk2_sol_qalloc.225.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit +cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.225.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(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.1, !dbg !9 -__hugr__.__tk2_sol_qalloc.221.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.225.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 %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.221.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.225.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(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.2, !dbg !9 -__hugr__.__tk2_sol_qalloc.221.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.225.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 %9 = load i64, ptr %1, align 4 %10 = and i64 %9, 4 %.not117 = icmp eq i64 %10, 0 br i1 %.not117, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.225.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(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.3, !dbg !9 -__hugr__.__tk2_sol_qalloc.221.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.225.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 %13 = load i64, ptr %1, align 4 %14 = and i64 %13, 8 %.not118 = icmp eq i64 %14, 0 br i1 %.not118, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.225.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(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.4, !dbg !9 -__hugr__.__tk2_sol_qalloc.221.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.225.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 %17 = load i64, ptr %1, align 4 %18 = and i64 %17, 16 %.not119 = icmp eq i64 %18, 0 br i1 %.not119, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.225.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(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.5, !dbg !9 -__hugr__.__tk2_sol_qalloc.221.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.225.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 %21 = load i64, ptr %1, align 4 %22 = and i64 %21, 32 %.not120 = icmp eq i64 %22, 0 br i1 %.not120, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.225.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(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.6, !dbg !9 -__hugr__.__tk2_sol_qalloc.221.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.225.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 %25 = load i64, ptr %1, align 4 %26 = and i64 %25, 64 %.not121 = icmp eq i64 %26, 0 br i1 %.not121, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.225.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(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.7, !dbg !9 -__hugr__.__tk2_sol_qalloc.221.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.225.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 %29 = load i64, ptr %1, align 4 %30 = and i64 %29, 128 %.not122 = icmp eq i64 %30, 0 br i1 %.not122, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.225.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(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.8, !dbg !9 -__hugr__.__tk2_sol_qalloc.221.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.225.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 %33 = load i64, ptr %1, align 4 %34 = and i64 %33, 256 %.not123 = icmp eq i64 %34, 0 br i1 %.not123, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.225.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(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_225_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_229_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-entry_args/entry_args_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-entry_args/entry_args_aarch64-apple-darwin_sol new file mode 100644 index 000000000..de416ccbd --- /dev/null +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-entry_args/entry_args_aarch64-apple-darwin_sol @@ -0,0 +1,408 @@ +; 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_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_a.19FB4E83.0 = private constant [11 x i8] c"\0AUSER:INT:a" +@res_b.0E048F9C.0 = private constant [13 x i8] c"\0CUSER:FLOAT:b" +@res_c.1C9EF4D1.0 = private constant [12 x i8] c"\0BUSER:BOOL:c" +@res_d.93EDD03A.0 = private constant [14 x i8] c"\0DUSER:INTARR:d" +@res_e.DB2DB1D9.0 = private constant [16 x i8] c"\0FUSER:FLOATARR:e" +@res_f.173699F1.0 = private constant [15 x i8] c"\0EUSER:BOOLARR:f" +@argument_arg_5.E3E8C60E.0 = private constant [6 x i8] c"\05arg_5" +@argument_arg_4.43DB6CC9.0 = private constant [6 x i8] c"\05arg_4" +@argument_arg_3.E6500947.0 = private constant [6 x i8] c"\05arg_3" +@argument_arg_2.32BF8FD7.0 = private constant [6 x i8] c"\05arg_2" +@argument_arg_1.12764F87.0 = private constant [6 x i8] c"\05arg_1" +@argument_arg_0.0A040DE9.0 = private constant [6 x i8] c"\05arg_0" + +define { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %0, double %1, i1 %2, { ptr, ptr, i64 } %3, { ptr, ptr, i64 } %4, { ptr, ptr, i64 } %5) local_unnamed_addr !dbg !4 { +alloca_block: + %.fca.0.extract161 = extractvalue { ptr, ptr, i64 } %3, 0 + %.fca.1.extract163 = extractvalue { ptr, ptr, i64 } %3, 1 + %.fca.2.extract165 = extractvalue { ptr, ptr, i64 } %3, 2 + %.fca.0.extract155 = extractvalue { ptr, ptr, i64 } %4, 0 + %.fca.1.extract157 = extractvalue { ptr, ptr, i64 } %4, 1 + %.fca.2.extract159 = extractvalue { ptr, ptr, i64 } %4, 2 + %.fca.0.extract149 = extractvalue { ptr, ptr, i64 } %5, 0 + %.fca.1.extract151 = extractvalue { ptr, ptr, i64 } %5, 1 + %.fca.2.extract153 = extractvalue { ptr, ptr, i64 } %5, 2 + %6 = lshr i64 %.fca.2.extract153, 6, !dbg !16 + %7 = getelementptr i64, ptr %.fca.1.extract151, i64 %6, !dbg !16 + %8 = load i64, ptr %7, align 4, !dbg !16 + %9 = and i64 %.fca.2.extract153, 63, !dbg !16 + %10 = shl nsw i64 -1, %9, !dbg !16 + %11 = and i64 %8, %10, !dbg !16 + store i64 %11, ptr %7, align 4, !dbg !16 + %last_valid.i = add i64 %.fca.2.extract153, 7, !dbg !16 + %12 = lshr i64 %last_valid.i, 6, !dbg !16 + %13 = getelementptr inbounds nuw i64, ptr %.fca.1.extract151, i64 %12, !dbg !16 + %14 = load i64, ptr %13, align 4, !dbg !16 + %15 = and i64 %last_valid.i, 63, !dbg !16 + %16 = xor i64 %15, 63, !dbg !16 + %17 = lshr i64 -1, %16, !dbg !16 + %18 = and i64 %14, %17, !dbg !16 + store i64 %18, ptr %13, align 4, !dbg !16 + %reass.sub.i = sub nsw i64 %12, %6, !dbg !16 + %.not.i = icmp eq i64 %reass.sub.i, -1, !dbg !16 + br i1 %.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +19: ; preds = %mask_block_ok.i + %20 = add nuw i64 %.02.i, 1, !dbg !16 + %exitcond.not.i = icmp eq i64 %.02.i, %reass.sub.i, !dbg !16 + br i1 %exitcond.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +mask_block_ok.i: ; preds = %alloca_block, %19 + %.02.i = phi i64 [ %20, %19 ], [ 0, %alloca_block ], !dbg !18 + %gep.i = getelementptr i64, ptr %7, i64 %.02.i, !dbg !16 + %21 = load i64, ptr %gep.i, align 4, !dbg !16 + %22 = icmp eq i64 %21, 0, !dbg !16 + br i1 %22, label %19, label %mask_block_err.i, !dbg !16 + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !16 + unreachable, !dbg !16 + +__barray_check_none_borrowed.exit: ; preds = %19, %alloca_block + %23 = tail call ptr @heap_alloc(i64 8), !dbg !18 + %24 = tail call ptr @heap_alloc(i64 8), !dbg !18 + store i64 0, ptr %24, align 1, !dbg !18 + %25 = getelementptr inbounds i1, ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %26 = load i64, ptr %25, align 1, !dbg !18 + store i64 %26, ptr %23, align 1, !dbg !18 + %27 = load i64, ptr %7, align 4, !dbg !19 + %28 = and i64 %27, %10, !dbg !19 + store i64 %28, ptr %7, align 4, !dbg !19 + %29 = load i64, ptr %13, align 4, !dbg !19 + %30 = and i64 %29, %17, !dbg !19 + store i64 %30, ptr %13, align 4, !dbg !19 + br i1 %.not.i, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +31: ; preds = %mask_block_ok.i183 + %32 = add nuw i64 %.02.i184, 1, !dbg !19 + %exitcond.not.i187 = icmp eq i64 %.02.i184, %reass.sub.i, !dbg !19 + br i1 %exitcond.not.i187, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +mask_block_ok.i183: ; preds = %__barray_check_none_borrowed.exit, %31 + %.02.i184 = phi i64 [ %32, %31 ], [ 0, %__barray_check_none_borrowed.exit ], !dbg !18 + %gep.i185 = getelementptr i64, ptr %7, i64 %.02.i184, !dbg !19 + %33 = load i64, ptr %gep.i185, align 4, !dbg !19 + %34 = icmp eq i64 %33, 0, !dbg !19 + br i1 %34, label %31, label %mask_block_err.i186, !dbg !19 + +mask_block_err.i186: ; preds = %mask_block_ok.i183 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !19 + unreachable, !dbg !19 + +__barray_check_none_borrowed.exit188: ; preds = %31, %__barray_check_none_borrowed.exit + %35 = lshr i64 %.fca.2.extract159, 6, !dbg !21 + %36 = getelementptr i64, ptr %.fca.1.extract157, i64 %35, !dbg !21 + %37 = load i64, ptr %36, align 4, !dbg !21 + %38 = and i64 %.fca.2.extract159, 63, !dbg !21 + %39 = shl nsw i64 -1, %38, !dbg !21 + %40 = and i64 %37, %39, !dbg !21 + store i64 %40, ptr %36, align 4, !dbg !21 + %last_valid.i189 = add i64 %.fca.2.extract159, 2, !dbg !21 + %41 = lshr i64 %last_valid.i189, 6, !dbg !21 + %42 = getelementptr inbounds nuw i64, ptr %.fca.1.extract157, i64 %41, !dbg !21 + %43 = load i64, ptr %42, align 4, !dbg !21 + %44 = and i64 %last_valid.i189, 63, !dbg !21 + %45 = xor i64 %44, 63, !dbg !21 + %46 = lshr i64 -1, %45, !dbg !21 + %47 = and i64 %43, %46, !dbg !21 + store i64 %47, ptr %42, align 4, !dbg !21 + %reass.sub.i190 = sub nsw i64 %41, %35, !dbg !21 + %.not.i191 = icmp eq i64 %reass.sub.i190, -1, !dbg !21 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +48: ; preds = %mask_block_ok.i192 + %49 = add nuw i64 %.02.i193, 1, !dbg !21 + %exitcond.not.i196 = icmp eq i64 %.02.i193, %reass.sub.i190, !dbg !21 + br i1 %exitcond.not.i196, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +mask_block_ok.i192: ; preds = %__barray_check_none_borrowed.exit188, %48 + %.02.i193 = phi i64 [ %49, %48 ], [ 0, %__barray_check_none_borrowed.exit188 ], !dbg !23 + %gep.i194 = getelementptr i64, ptr %36, i64 %.02.i193, !dbg !21 + %50 = load i64, ptr %gep.i194, align 4, !dbg !21 + %51 = icmp eq i64 %50, 0, !dbg !21 + br i1 %51, label %48, label %mask_block_err.i195, !dbg !21 + +mask_block_err.i195: ; preds = %mask_block_ok.i192 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !21 + unreachable, !dbg !21 + +__barray_check_none_borrowed.exit197: ; preds = %48, %__barray_check_none_borrowed.exit188 + %52 = tail call ptr @heap_alloc(i64 24), !dbg !23 + %53 = tail call ptr @heap_alloc(i64 8), !dbg !23 + store i64 0, ptr %53, align 1, !dbg !23 + %54 = getelementptr inbounds double, ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(24) %52, ptr noundef nonnull align 1 dereferenceable(24) %54, i64 24, i1 false), !dbg !23 + %55 = load i64, ptr %36, align 4, !dbg !24 + %56 = and i64 %55, %39, !dbg !24 + store i64 %56, ptr %36, align 4, !dbg !24 + %57 = load i64, ptr %42, align 4, !dbg !24 + %58 = and i64 %57, %46, !dbg !24 + store i64 %58, ptr %42, align 4, !dbg !24 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +59: ; preds = %mask_block_ok.i201 + %60 = add nuw i64 %.02.i202, 1, !dbg !24 + %exitcond.not.i205 = icmp eq i64 %.02.i202, %reass.sub.i190, !dbg !24 + br i1 %exitcond.not.i205, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +mask_block_ok.i201: ; preds = %__barray_check_none_borrowed.exit197, %59 + %.02.i202 = phi i64 [ %60, %59 ], [ 0, %__barray_check_none_borrowed.exit197 ], !dbg !23 + %gep.i203 = getelementptr i64, ptr %36, i64 %.02.i202, !dbg !24 + %61 = load i64, ptr %gep.i203, align 4, !dbg !24 + %62 = icmp eq i64 %61, 0, !dbg !24 + br i1 %62, label %59, label %mask_block_err.i204, !dbg !24 + +mask_block_err.i204: ; preds = %mask_block_ok.i201 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !24 + unreachable, !dbg !24 + +__barray_check_none_borrowed.exit206: ; preds = %59, %__barray_check_none_borrowed.exit197 + %63 = lshr i64 %.fca.2.extract165, 6, !dbg !26 + %64 = getelementptr i64, ptr %.fca.1.extract163, i64 %63, !dbg !26 + %65 = load i64, ptr %64, align 4, !dbg !26 + %66 = and i64 %.fca.2.extract165, 63, !dbg !26 + %67 = shl nsw i64 -1, %66, !dbg !26 + %68 = and i64 %65, %67, !dbg !26 + store i64 %68, ptr %64, align 4, !dbg !26 + %last_valid.i207 = add i64 %.fca.2.extract165, 4, !dbg !26 + %69 = lshr i64 %last_valid.i207, 6, !dbg !26 + %70 = getelementptr inbounds nuw i64, ptr %.fca.1.extract163, i64 %69, !dbg !26 + %71 = load i64, ptr %70, align 4, !dbg !26 + %72 = and i64 %last_valid.i207, 63, !dbg !26 + %73 = xor i64 %72, 63, !dbg !26 + %74 = lshr i64 -1, %73, !dbg !26 + %75 = and i64 %71, %74, !dbg !26 + store i64 %75, ptr %70, align 4, !dbg !26 + %reass.sub.i208 = sub nsw i64 %69, %63, !dbg !26 + %.not.i209 = icmp eq i64 %reass.sub.i208, -1, !dbg !26 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +76: ; preds = %mask_block_ok.i210 + %77 = add nuw i64 %.02.i211, 1, !dbg !26 + %exitcond.not.i214 = icmp eq i64 %.02.i211, %reass.sub.i208, !dbg !26 + br i1 %exitcond.not.i214, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +mask_block_ok.i210: ; preds = %__barray_check_none_borrowed.exit206, %76 + %.02.i211 = phi i64 [ %77, %76 ], [ 0, %__barray_check_none_borrowed.exit206 ], !dbg !28 + %gep.i212 = getelementptr i64, ptr %64, i64 %.02.i211, !dbg !26 + %78 = load i64, ptr %gep.i212, align 4, !dbg !26 + %79 = icmp eq i64 %78, 0, !dbg !26 + br i1 %79, label %76, label %mask_block_err.i213, !dbg !26 + +mask_block_err.i213: ; preds = %mask_block_ok.i210 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !26 + unreachable, !dbg !26 + +__barray_check_none_borrowed.exit215: ; preds = %76, %__barray_check_none_borrowed.exit206 + %80 = tail call ptr @heap_alloc(i64 40), !dbg !28 + %81 = tail call ptr @heap_alloc(i64 8), !dbg !28 + store i64 0, ptr %81, align 1, !dbg !28 + %82 = getelementptr inbounds i64, ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(40) %80, ptr noundef nonnull align 1 dereferenceable(40) %82, i64 40, i1 false), !dbg !28 + %83 = load i64, ptr %64, align 4, !dbg !29 + %84 = and i64 %83, %67, !dbg !29 + store i64 %84, ptr %64, align 4, !dbg !29 + %85 = load i64, ptr %70, align 4, !dbg !29 + %86 = and i64 %85, %74, !dbg !29 + store i64 %86, ptr %70, align 4, !dbg !29 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +87: ; preds = %mask_block_ok.i219 + %88 = add nuw i64 %.02.i220, 1, !dbg !29 + %exitcond.not.i223 = icmp eq i64 %.02.i220, %reass.sub.i208, !dbg !29 + br i1 %exitcond.not.i223, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +mask_block_ok.i219: ; preds = %__barray_check_none_borrowed.exit215, %87 + %.02.i220 = phi i64 [ %88, %87 ], [ 0, %__barray_check_none_borrowed.exit215 ], !dbg !28 + %gep.i221 = getelementptr i64, ptr %64, i64 %.02.i220, !dbg !29 + %89 = load i64, ptr %gep.i221, align 4, !dbg !29 + %90 = icmp eq i64 %89, 0, !dbg !29 + br i1 %90, label %87, label %mask_block_err.i222, !dbg !29 + +mask_block_err.i222: ; preds = %mask_block_ok.i219 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !29 + unreachable, !dbg !29 + +__barray_check_none_borrowed.exit224: ; preds = %87, %__barray_check_none_borrowed.exit215 + %91 = insertvalue { ptr, ptr, i64 } poison, ptr %80, 0, !dbg !28 + %92 = insertvalue { ptr, ptr, i64 } %91, ptr %81, 1, !dbg !28 + %93 = insertvalue { ptr, ptr, i64 } %92, i64 0, 2, !dbg !28 + %94 = insertvalue { ptr, ptr, i64 } poison, ptr %52, 0, !dbg !23 + %95 = insertvalue { ptr, ptr, i64 } %94, ptr %53, 1, !dbg !23 + %96 = insertvalue { ptr, ptr, i64 } %95, i64 0, 2, !dbg !23 + %97 = insertvalue { ptr, ptr, i64 } poison, ptr %23, 0, !dbg !18 + %98 = insertvalue { ptr, ptr, i64 } %97, ptr %24, 1, !dbg !18 + %99 = insertvalue { ptr, ptr, i64 } %98, i64 0, 2, !dbg !18 + tail call void @print_int(ptr nonnull @res_a.19FB4E83.0, i64 10, i64 %0), !dbg !31 + tail call void @print_float(ptr nonnull @res_b.0E048F9C.0, i64 12, double %1), !dbg !32 + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %2), !dbg !33 + %100 = getelementptr inbounds [5 x i64], ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !28 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4, !dbg !28 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8, !dbg !28 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16, !dbg !28 + %101 = alloca [5 x i1], align 1, !dbg !28 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %101, i8 0, i64 5, i1 false), !dbg !28 + store i32 5, ptr %out_arr_alloca, align 8, !dbg !28 + store i32 1, ptr %y_ptr, align 4, !dbg !28 + store ptr %100, ptr %arr_ptr, align 8, !dbg !28 + store ptr %101, ptr %mask_ptr, align 8, !dbg !28 + call void @print_int_arr(ptr nonnull @res_d.93EDD03A.0, i64 13, ptr nonnull %out_arr_alloca), !dbg !28 + %102 = getelementptr inbounds [3 x double], ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + %out_arr_alloca57 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !23 + %y_ptr59 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 4, !dbg !23 + %arr_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 8, !dbg !23 + %mask_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 16, !dbg !23 + %103 = alloca [3 x i1], align 1, !dbg !23 + store i1 false, ptr %103, align 1, !dbg !23 + %.repack171 = getelementptr inbounds nuw i8, ptr %103, i64 1, !dbg !23 + store i1 false, ptr %.repack171, align 1, !dbg !23 + %.repack172 = getelementptr inbounds nuw i8, ptr %103, i64 2, !dbg !23 + store i1 false, ptr %.repack172, align 1, !dbg !23 + store i32 3, ptr %out_arr_alloca57, align 8, !dbg !23 + store i32 1, ptr %y_ptr59, align 4, !dbg !23 + store ptr %102, ptr %arr_ptr60, align 8, !dbg !23 + store ptr %103, ptr %mask_ptr61, align 8, !dbg !23 + call void @print_float_arr(ptr nonnull @res_e.DB2DB1D9.0, i64 15, ptr nonnull %out_arr_alloca57), !dbg !23 + %104 = getelementptr inbounds [8 x i1], ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %out_arr_alloca67 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !18 + %y_ptr69 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 4, !dbg !18 + %arr_ptr70 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 8, !dbg !18 + %mask_ptr71 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 16, !dbg !18 + %105 = alloca [8 x i1], align 8, !dbg !18 + store i64 0, ptr %105, align 8, !dbg !18 + store i32 8, ptr %out_arr_alloca67, align 8, !dbg !18 + store i32 1, ptr %y_ptr69, align 4, !dbg !18 + store ptr %104, ptr %arr_ptr70, align 8, !dbg !18 + store ptr %105, ptr %mask_ptr71, align 8, !dbg !18 + call void @print_bool_arr(ptr nonnull @res_f.173699F1.0, i64 14, ptr nonnull %out_arr_alloca67), !dbg !18 + %mrv = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } poison, { ptr, ptr, i64 } %93, 0 + %mrv89 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv, { ptr, ptr, i64 } %96, 1 + %mrv90 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv89, { ptr, ptr, i64 } %99, 2 + ret { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv90 +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #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 @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_float(ptr, i64, double) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) 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 @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @argreader_get_bool_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_f64_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_i64_array(ptr, ptr, i64) local_unnamed_addr + +declare i1 @argreader_get_bool(ptr) local_unnamed_addr + +declare double @argreader_get_f64(ptr) local_unnamed_addr + +declare i64 @argreader_get_i64(ptr) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !34 { +entry: + tail call void @setup(i64 %0), !dbg !38 + %1 = tail call ptr @heap_alloc(i64 8), !dbg !38 + %2 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %2, align 1, !dbg !38 + %3 = insertvalue { ptr, ptr, i64 } poison, ptr %1, 0, !dbg !38 + %4 = insertvalue { ptr, ptr, i64 } %3, ptr %2, 1, !dbg !38 + %5 = insertvalue { ptr, ptr, i64 } %4, i64 0, 2, !dbg !38 + tail call void @argreader_get_bool_array(ptr nonnull @argument_arg_5.E3E8C60E.0, ptr %1, i64 8), !dbg !38 + %6 = tail call ptr @heap_alloc(i64 24), !dbg !38 + %7 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %7, align 1, !dbg !38 + %8 = insertvalue { ptr, ptr, i64 } poison, ptr %6, 0, !dbg !38 + %9 = insertvalue { ptr, ptr, i64 } %8, ptr %7, 1, !dbg !38 + %10 = insertvalue { ptr, ptr, i64 } %9, i64 0, 2, !dbg !38 + tail call void @argreader_get_f64_array(ptr nonnull @argument_arg_4.43DB6CC9.0, ptr %6, i64 3), !dbg !38 + %11 = tail call ptr @heap_alloc(i64 40), !dbg !38 + %12 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %12, align 1, !dbg !38 + %13 = insertvalue { ptr, ptr, i64 } poison, ptr %11, 0, !dbg !38 + %14 = insertvalue { ptr, ptr, i64 } %13, ptr %12, 1, !dbg !38 + %15 = insertvalue { ptr, ptr, i64 } %14, i64 0, 2, !dbg !38 + tail call void @argreader_get_i64_array(ptr nonnull @argument_arg_3.E6500947.0, ptr %11, i64 5), !dbg !38 + %read_arg_bool.i = tail call i1 @argreader_get_bool(ptr nonnull @argument_arg_2.32BF8FD7.0), !dbg !38 + %read_arg_f64.i = tail call double @argreader_get_f64(ptr nonnull @argument_arg_1.12764F87.0), !dbg !38 + %read_arg_int.i = tail call i64 @argreader_get_i64(ptr nonnull @argument_arg_0.0A040DE9.0), !dbg !38 + %16 = tail call { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %read_arg_int.i, double %read_arg_f64.i, i1 %read_arg_bool.i, { ptr, ptr, i64 } %15, { ptr, ptr, i64 } %10, { ptr, ptr, i64 } %5), !dbg !38 + %17 = tail call i64 @teardown(), !dbg !38 + ret i64 %17, !dbg !38 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } +attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } + +!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.0-a3)-v1.0.0-a3", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "entry_args..foo", linkageName: "__hugr__.__main__.entry_args..foo.1", scope: null, file: !5, line: 247, type: !6, scopeLine: 248, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!6 = !DISubroutineType(types: !7) +!7 = !{!8, !13, !14, !15, !10, !10, !10} +!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } }", file: !2, size: 576, align: 8, elements: !9) +!9 = !{!10, !10, !10} +!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !11) +!11 = !{!12, !12, !13} +!12 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DIBasicType(name: "f64", size: 64, encoding: DW_ATE_float) +!15 = !DIBasicType(name: "i1", size: 1, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !17) +!17 = distinct !DILocation(line: 253, column: 8, scope: !4) +!18 = !DILocation(line: 253, column: 8, scope: !4) +!19 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !20) +!20 = distinct !DILocation(line: 253, column: 8, scope: !4) +!21 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !22) +!22 = distinct !DILocation(line: 252, column: 8, scope: !4) +!23 = !DILocation(line: 252, column: 8, scope: !4) +!24 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !25) +!25 = distinct !DILocation(line: 252, column: 8, scope: !4) +!26 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !27) +!27 = distinct !DILocation(line: 251, column: 8, scope: !4) +!28 = !DILocation(line: 251, column: 8, scope: !4) +!29 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !30) +!30 = distinct !DILocation(line: 251, column: 8, scope: !4) +!31 = !DILocation(line: 248, column: 8, scope: !4) +!32 = !DILocation(line: 249, column: 8, scope: !4) +!33 = !DILocation(line: 250, column: 8, scope: !4) +!34 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !35, type: !36, spFlags: DISPFlagDefinition, unit: !1) +!35 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!36 = !DISubroutineType(types: !37) +!37 = !{!13, !13} +!38 = !DILocation(line: 0, scope: !34) \ No newline at end of file diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol index 285b19026..7fd0523a7 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37, !dbg !10 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41, !dbg !11 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45, !dbg !13 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol index ff47a0350..5a02d42d9 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol @@ -15,157 +15,157 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit, !dbg !9 -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_sol_qalloc.374.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.378.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !9 %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.9, %__hugr__.__tk2_sol_qalloc.374.exit.8, %__hugr__.__tk2_sol_qalloc.374.exit.7, %__hugr__.__tk2_sol_qalloc.374.exit.6, %__hugr__.__tk2_sol_qalloc.374.exit.5, %__hugr__.__tk2_sol_qalloc.374.exit.4, %__hugr__.__tk2_sol_qalloc.374.exit.3, %__hugr__.__tk2_sol_qalloc.374.exit.2, %__hugr__.__tk2_sol_qalloc.374.exit.1, %__hugr__.__tk2_sol_qalloc.374.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.378.exit.8, %__hugr__.__tk2_sol_qalloc.378.exit.7, %__hugr__.__tk2_sol_qalloc.378.exit.6, %__hugr__.__tk2_sol_qalloc.378.exit.5, %__hugr__.__tk2_sol_qalloc.378.exit.4, %__hugr__.__tk2_sol_qalloc.378.exit.3, %__hugr__.__tk2_sol_qalloc.378.exit.2, %__hugr__.__tk2_sol_qalloc.378.exit.1, %__hugr__.__tk2_sol_qalloc.378.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit +cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.378.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(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.1, !dbg !9 -__hugr__.__tk2_sol_qalloc.374.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.378.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not199 = icmp eq i64 %6, 0 br i1 %.not199, label %panic.i, label %cond_exit_20.1 -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.378.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(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.2, !dbg !9 -__hugr__.__tk2_sol_qalloc.374.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.378.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 %9 = load i64, ptr %1, align 4 %10 = and i64 %9, 4 %.not200 = icmp eq i64 %10, 0 br i1 %.not200, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.378.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(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.3, !dbg !9 -__hugr__.__tk2_sol_qalloc.374.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.378.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 %13 = load i64, ptr %1, align 4 %14 = and i64 %13, 8 %.not201 = icmp eq i64 %14, 0 br i1 %.not201, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.378.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(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.4, !dbg !9 -__hugr__.__tk2_sol_qalloc.374.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.378.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 %17 = load i64, ptr %1, align 4 %18 = and i64 %17, 16 %.not202 = icmp eq i64 %18, 0 br i1 %.not202, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.378.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(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.5, !dbg !9 -__hugr__.__tk2_sol_qalloc.374.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.378.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 %21 = load i64, ptr %1, align 4 %22 = and i64 %21, 32 %.not203 = icmp eq i64 %22, 0 br i1 %.not203, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.378.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(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.6, !dbg !9 -__hugr__.__tk2_sol_qalloc.374.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.378.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 %25 = load i64, ptr %1, align 4 %26 = and i64 %25, 64 %.not204 = icmp eq i64 %26, 0 br i1 %.not204, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.378.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(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.7, !dbg !9 -__hugr__.__tk2_sol_qalloc.374.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.378.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 %29 = load i64, ptr %1, align 4 %30 = and i64 %29, 128 %.not205 = icmp eq i64 %30, 0 br i1 %.not205, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.378.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(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.8, !dbg !9 -__hugr__.__tk2_sol_qalloc.374.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.378.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 %33 = load i64, ptr %1, align 4 %34 = and i64 %33, 256 %.not206 = icmp eq i64 %34, 0 br i1 %.not206, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.378.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(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -399,16 +399,16 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 - %117 = lshr i64 %"421_1.sroa.10.0.i.i", 6 - %118 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %117 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 + %117 = lshr i64 %"425_1.sroa.10.0.i.i", 6 + %118 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %117 %119 = load i64, ptr %118, align 4 - %120 = and i64 %"421_1.sroa.10.0.i.i", 63 + %120 = and i64 %"425_1.sroa.10.0.i.i", 63 %121 = lshr i64 %119, %120 %122 = trunc i64 %121 to i1 - br i1 %122, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %122, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" %123 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" ], [ %265, %loop_body.i177 ] @@ -452,8 +452,8 @@ panic.i222.i.i: ; preds = %__barray_check_boun %exitcond.not.i.i.i185 = icmp eq i64 %.02.i.i.i182, %reass.sub.i.i.i179, !dbg !72 br i1 %exitcond.not.i.i.i185, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i181, !dbg !72 -mask_block_ok.i.i.i181: ; preds = %cond_exit_424.thread.9.i.i, %139 - %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_424.thread.9.i.i ] +mask_block_ok.i.i.i181: ; preds = %cond_exit_428.thread.9.i.i, %139 + %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_428.thread.9.i.i ] %gep.i.i.i183 = getelementptr i64, ptr %118, i64 %.02.i.i.i182, !dbg !72 %141 = load i64, ptr %gep.i.i.i183, align 4, !dbg !72 %142 = icmp eq i64 %141, -1, !dbg !72 @@ -467,183 +467,183 @@ __barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader %143 = shl nuw i64 1, %120, !dbg !71 %144 = xor i64 %119, %143, !dbg !71 store i64 %144, ptr %118, align 4, !dbg !71 - %145 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %"421_1.sroa.10.0.i.i" + %145 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %"425_1.sroa.10.0.i.i" %146 = load i64, ptr %145, align 4 tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %147 = add i64 %"421_1.sroa.10.0.i.i", 1 +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i + %147 = add i64 %"425_1.sroa.10.0.i.i", 1 %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %148 + %149 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i + br i1 %153, label %cond_exit_428.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_424.thread.i.i +__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_428.thread.i.i %154 = shl nuw i64 1, %151, !dbg !71 %155 = xor i64 %150, %154, !dbg !71 store i64 %155, ptr %149, align 4, !dbg !71 - %156 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %147 + %156 = getelementptr inbounds i64, ptr %"425_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_424.thread.1.i.i + br label %cond_exit_428.thread.1.i.i -cond_exit_424.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_424.thread.i.i - %158 = add i64 %"421_1.sroa.10.0.i.i", 2 +cond_exit_428.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_428.thread.i.i + %158 = add i64 %"425_1.sroa.10.0.i.i", 2 %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i + br i1 %164, label %cond_exit_428.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_424.thread.1.i.i +__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_428.thread.1.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %161, %165, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.2.i.i + br label %cond_exit_428.thread.2.i.i -cond_exit_424.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_424.thread.1.i.i - %169 = add i64 %"421_1.sroa.10.0.i.i", 3 +cond_exit_428.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_428.thread.1.i.i + %169 = add i64 %"425_1.sroa.10.0.i.i", 3 %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %170 + %171 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i + br i1 %175, label %cond_exit_428.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_424.thread.2.i.i +__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_428.thread.2.i.i %176 = shl nuw i64 1, %173, !dbg !71 %177 = xor i64 %172, %176, !dbg !71 store i64 %177, ptr %171, align 4, !dbg !71 - %178 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %169 + %178 = getelementptr inbounds i64, ptr %"425_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_424.thread.3.i.i + br label %cond_exit_428.thread.3.i.i -cond_exit_424.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_424.thread.2.i.i - %180 = add i64 %"421_1.sroa.10.0.i.i", 4 +cond_exit_428.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_428.thread.2.i.i + %180 = add i64 %"425_1.sroa.10.0.i.i", 4 %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %181 + %182 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i + br i1 %186, label %cond_exit_428.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_424.thread.3.i.i +__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_428.thread.3.i.i %187 = shl nuw i64 1, %184, !dbg !71 %188 = xor i64 %183, %187, !dbg !71 store i64 %188, ptr %182, align 4, !dbg !71 - %189 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %180 + %189 = getelementptr inbounds i64, ptr %"425_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_424.thread.4.i.i + br label %cond_exit_428.thread.4.i.i -cond_exit_424.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_424.thread.3.i.i - %191 = add i64 %"421_1.sroa.10.0.i.i", 5 +cond_exit_428.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_428.thread.3.i.i + %191 = add i64 %"425_1.sroa.10.0.i.i", 5 %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %192 + %193 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i + br i1 %197, label %cond_exit_428.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_424.thread.4.i.i +__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_428.thread.4.i.i %198 = shl nuw i64 1, %195, !dbg !71 %199 = xor i64 %194, %198, !dbg !71 store i64 %199, ptr %193, align 4, !dbg !71 - %200 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %191 + %200 = getelementptr inbounds i64, ptr %"425_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_424.thread.5.i.i + br label %cond_exit_428.thread.5.i.i -cond_exit_424.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_424.thread.4.i.i - %202 = add i64 %"421_1.sroa.10.0.i.i", 6 +cond_exit_428.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_428.thread.4.i.i + %202 = add i64 %"425_1.sroa.10.0.i.i", 6 %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %203 + %204 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i + br i1 %208, label %cond_exit_428.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_424.thread.5.i.i +__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_428.thread.5.i.i %209 = shl nuw i64 1, %206, !dbg !71 %210 = xor i64 %205, %209, !dbg !71 store i64 %210, ptr %204, align 4, !dbg !71 - %211 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %202 + %211 = getelementptr inbounds i64, ptr %"425_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_424.thread.6.i.i + br label %cond_exit_428.thread.6.i.i -cond_exit_424.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_424.thread.5.i.i - %213 = add i64 %"421_1.sroa.10.0.i.i", 7 +cond_exit_428.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_428.thread.5.i.i + %213 = add i64 %"425_1.sroa.10.0.i.i", 7 %214 = lshr i64 %213, 6 - %215 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %214 + %215 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %214 %216 = load i64, ptr %215, align 4 %217 = and i64 %213, 63 %218 = lshr i64 %216, %217 %219 = trunc i64 %218 to i1 - br i1 %219, label %cond_exit_424.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i + br i1 %219, label %cond_exit_428.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_424.thread.6.i.i +__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_428.thread.6.i.i %220 = shl nuw i64 1, %217, !dbg !71 %221 = xor i64 %216, %220, !dbg !71 store i64 %221, ptr %215, align 4, !dbg !71 - %222 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %213 + %222 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %213 %223 = load i64, ptr %222, align 4 tail call void @___dec_future_refcount(i64 %223) - br label %cond_exit_424.thread.7.i.i + br label %cond_exit_428.thread.7.i.i -cond_exit_424.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_424.thread.6.i.i - %224 = add i64 %"421_1.sroa.10.0.i.i", 8 +cond_exit_428.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_428.thread.6.i.i + %224 = add i64 %"425_1.sroa.10.0.i.i", 8 %225 = lshr i64 %224, 6 - %226 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %225 + %226 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %225 %227 = load i64, ptr %226, align 4 %228 = and i64 %224, 63 %229 = lshr i64 %227, %228 %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_424.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i + br i1 %230, label %cond_exit_428.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_424.thread.7.i.i +__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_428.thread.7.i.i %231 = shl nuw i64 1, %228, !dbg !71 %232 = xor i64 %227, %231, !dbg !71 store i64 %232, ptr %226, align 4, !dbg !71 - %233 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %224 + %233 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %224 %234 = load i64, ptr %233, align 4 tail call void @___dec_future_refcount(i64 %234) - br label %cond_exit_424.thread.8.i.i + br label %cond_exit_428.thread.8.i.i -cond_exit_424.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_424.thread.7.i.i - %235 = add i64 %"421_1.sroa.10.0.i.i", 9 +cond_exit_428.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_428.thread.7.i.i + %235 = add i64 %"425_1.sroa.10.0.i.i", 9 %236 = lshr i64 %235, 6 - %237 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %236 + %237 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %236 %238 = load i64, ptr %237, align 4 %239 = and i64 %235, 63 %240 = lshr i64 %238, %239 %241 = trunc i64 %240 to i1 - br i1 %241, label %cond_exit_424.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i + br i1 %241, label %cond_exit_428.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_424.thread.8.i.i +__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_428.thread.8.i.i %242 = shl nuw i64 1, %239, !dbg !71 %243 = xor i64 %238, %242, !dbg !71 store i64 %243, ptr %237, align 4, !dbg !71 - %244 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %235 + %244 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %235 %245 = load i64, ptr %244, align 4 tail call void @___dec_future_refcount(i64 %245) - br label %cond_exit_424.thread.9.i.i + br label %cond_exit_428.thread.9.i.i -cond_exit_424.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_424.thread.8.i.i +cond_exit_428.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_428.thread.8.i.i %246 = load i64, ptr %118, align 4, !dbg !72 %247 = sub nuw nsw i64 64, %120, !dbg !72 %248 = lshr i64 -1, %247, !dbg !72 @@ -687,9 +687,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %124, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_424.thread.9.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_428.thread.9.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %115) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol index 70c828970..2863518d5 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit, !dbg !8 -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol index f74ad29c5..ae60f7881 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit, !dbg !8 -cond_44_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"), !dbg !8 unreachable, !dbg !8 -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol index cc7c30326..03d192419 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit, !dbg !8 -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.38.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.42.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol index 4578def41..e44553352 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 + %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol index 142bb5af0..4d603759d 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit, !dbg !8 -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] +__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i, !dbg !15 -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol index 4a439c466..86e543e5a 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol @@ -14,9 +14,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_225_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_229_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-entry_args/entry_args_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-entry_args/entry_args_x86_64-apple-darwin_sol new file mode 100644 index 000000000..47fefc5f7 --- /dev/null +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-entry_args/entry_args_x86_64-apple-darwin_sol @@ -0,0 +1,408 @@ +; 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_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_a.19FB4E83.0 = private constant [11 x i8] c"\0AUSER:INT:a" +@res_b.0E048F9C.0 = private constant [13 x i8] c"\0CUSER:FLOAT:b" +@res_c.1C9EF4D1.0 = private constant [12 x i8] c"\0BUSER:BOOL:c" +@res_d.93EDD03A.0 = private constant [14 x i8] c"\0DUSER:INTARR:d" +@res_e.DB2DB1D9.0 = private constant [16 x i8] c"\0FUSER:FLOATARR:e" +@res_f.173699F1.0 = private constant [15 x i8] c"\0EUSER:BOOLARR:f" +@argument_arg_5.E3E8C60E.0 = private constant [6 x i8] c"\05arg_5" +@argument_arg_4.43DB6CC9.0 = private constant [6 x i8] c"\05arg_4" +@argument_arg_3.E6500947.0 = private constant [6 x i8] c"\05arg_3" +@argument_arg_2.32BF8FD7.0 = private constant [6 x i8] c"\05arg_2" +@argument_arg_1.12764F87.0 = private constant [6 x i8] c"\05arg_1" +@argument_arg_0.0A040DE9.0 = private constant [6 x i8] c"\05arg_0" + +define { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %0, double %1, i1 %2, { ptr, ptr, i64 } %3, { ptr, ptr, i64 } %4, { ptr, ptr, i64 } %5) local_unnamed_addr !dbg !4 { +alloca_block: + %.fca.0.extract161 = extractvalue { ptr, ptr, i64 } %3, 0 + %.fca.1.extract163 = extractvalue { ptr, ptr, i64 } %3, 1 + %.fca.2.extract165 = extractvalue { ptr, ptr, i64 } %3, 2 + %.fca.0.extract155 = extractvalue { ptr, ptr, i64 } %4, 0 + %.fca.1.extract157 = extractvalue { ptr, ptr, i64 } %4, 1 + %.fca.2.extract159 = extractvalue { ptr, ptr, i64 } %4, 2 + %.fca.0.extract149 = extractvalue { ptr, ptr, i64 } %5, 0 + %.fca.1.extract151 = extractvalue { ptr, ptr, i64 } %5, 1 + %.fca.2.extract153 = extractvalue { ptr, ptr, i64 } %5, 2 + %6 = lshr i64 %.fca.2.extract153, 6, !dbg !16 + %7 = getelementptr i64, ptr %.fca.1.extract151, i64 %6, !dbg !16 + %8 = load i64, ptr %7, align 4, !dbg !16 + %9 = and i64 %.fca.2.extract153, 63, !dbg !16 + %10 = shl nsw i64 -1, %9, !dbg !16 + %11 = and i64 %8, %10, !dbg !16 + store i64 %11, ptr %7, align 4, !dbg !16 + %last_valid.i = add i64 %.fca.2.extract153, 7, !dbg !16 + %12 = lshr i64 %last_valid.i, 6, !dbg !16 + %13 = getelementptr inbounds nuw i64, ptr %.fca.1.extract151, i64 %12, !dbg !16 + %14 = load i64, ptr %13, align 4, !dbg !16 + %15 = and i64 %last_valid.i, 63, !dbg !16 + %16 = xor i64 %15, 63, !dbg !16 + %17 = lshr i64 -1, %16, !dbg !16 + %18 = and i64 %14, %17, !dbg !16 + store i64 %18, ptr %13, align 4, !dbg !16 + %reass.sub.i = sub nsw i64 %12, %6, !dbg !16 + %.not.i = icmp eq i64 %reass.sub.i, -1, !dbg !16 + br i1 %.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +19: ; preds = %mask_block_ok.i + %20 = add nuw i64 %.02.i, 1, !dbg !16 + %exitcond.not.i = icmp eq i64 %.02.i, %reass.sub.i, !dbg !16 + br i1 %exitcond.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +mask_block_ok.i: ; preds = %alloca_block, %19 + %.02.i = phi i64 [ %20, %19 ], [ 0, %alloca_block ], !dbg !18 + %gep.i = getelementptr i64, ptr %7, i64 %.02.i, !dbg !16 + %21 = load i64, ptr %gep.i, align 4, !dbg !16 + %22 = icmp eq i64 %21, 0, !dbg !16 + br i1 %22, label %19, label %mask_block_err.i, !dbg !16 + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !16 + unreachable, !dbg !16 + +__barray_check_none_borrowed.exit: ; preds = %19, %alloca_block + %23 = tail call ptr @heap_alloc(i64 8), !dbg !18 + %24 = tail call ptr @heap_alloc(i64 8), !dbg !18 + store i64 0, ptr %24, align 1, !dbg !18 + %25 = getelementptr inbounds i1, ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %26 = load i64, ptr %25, align 1, !dbg !18 + store i64 %26, ptr %23, align 1, !dbg !18 + %27 = load i64, ptr %7, align 4, !dbg !19 + %28 = and i64 %27, %10, !dbg !19 + store i64 %28, ptr %7, align 4, !dbg !19 + %29 = load i64, ptr %13, align 4, !dbg !19 + %30 = and i64 %29, %17, !dbg !19 + store i64 %30, ptr %13, align 4, !dbg !19 + br i1 %.not.i, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +31: ; preds = %mask_block_ok.i183 + %32 = add nuw i64 %.02.i184, 1, !dbg !19 + %exitcond.not.i187 = icmp eq i64 %.02.i184, %reass.sub.i, !dbg !19 + br i1 %exitcond.not.i187, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +mask_block_ok.i183: ; preds = %__barray_check_none_borrowed.exit, %31 + %.02.i184 = phi i64 [ %32, %31 ], [ 0, %__barray_check_none_borrowed.exit ], !dbg !18 + %gep.i185 = getelementptr i64, ptr %7, i64 %.02.i184, !dbg !19 + %33 = load i64, ptr %gep.i185, align 4, !dbg !19 + %34 = icmp eq i64 %33, 0, !dbg !19 + br i1 %34, label %31, label %mask_block_err.i186, !dbg !19 + +mask_block_err.i186: ; preds = %mask_block_ok.i183 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !19 + unreachable, !dbg !19 + +__barray_check_none_borrowed.exit188: ; preds = %31, %__barray_check_none_borrowed.exit + %35 = lshr i64 %.fca.2.extract159, 6, !dbg !21 + %36 = getelementptr i64, ptr %.fca.1.extract157, i64 %35, !dbg !21 + %37 = load i64, ptr %36, align 4, !dbg !21 + %38 = and i64 %.fca.2.extract159, 63, !dbg !21 + %39 = shl nsw i64 -1, %38, !dbg !21 + %40 = and i64 %37, %39, !dbg !21 + store i64 %40, ptr %36, align 4, !dbg !21 + %last_valid.i189 = add i64 %.fca.2.extract159, 2, !dbg !21 + %41 = lshr i64 %last_valid.i189, 6, !dbg !21 + %42 = getelementptr inbounds nuw i64, ptr %.fca.1.extract157, i64 %41, !dbg !21 + %43 = load i64, ptr %42, align 4, !dbg !21 + %44 = and i64 %last_valid.i189, 63, !dbg !21 + %45 = xor i64 %44, 63, !dbg !21 + %46 = lshr i64 -1, %45, !dbg !21 + %47 = and i64 %43, %46, !dbg !21 + store i64 %47, ptr %42, align 4, !dbg !21 + %reass.sub.i190 = sub nsw i64 %41, %35, !dbg !21 + %.not.i191 = icmp eq i64 %reass.sub.i190, -1, !dbg !21 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +48: ; preds = %mask_block_ok.i192 + %49 = add nuw i64 %.02.i193, 1, !dbg !21 + %exitcond.not.i196 = icmp eq i64 %.02.i193, %reass.sub.i190, !dbg !21 + br i1 %exitcond.not.i196, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +mask_block_ok.i192: ; preds = %__barray_check_none_borrowed.exit188, %48 + %.02.i193 = phi i64 [ %49, %48 ], [ 0, %__barray_check_none_borrowed.exit188 ], !dbg !23 + %gep.i194 = getelementptr i64, ptr %36, i64 %.02.i193, !dbg !21 + %50 = load i64, ptr %gep.i194, align 4, !dbg !21 + %51 = icmp eq i64 %50, 0, !dbg !21 + br i1 %51, label %48, label %mask_block_err.i195, !dbg !21 + +mask_block_err.i195: ; preds = %mask_block_ok.i192 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !21 + unreachable, !dbg !21 + +__barray_check_none_borrowed.exit197: ; preds = %48, %__barray_check_none_borrowed.exit188 + %52 = tail call ptr @heap_alloc(i64 24), !dbg !23 + %53 = tail call ptr @heap_alloc(i64 8), !dbg !23 + store i64 0, ptr %53, align 1, !dbg !23 + %54 = getelementptr inbounds double, ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(24) %52, ptr noundef nonnull align 1 dereferenceable(24) %54, i64 24, i1 false), !dbg !23 + %55 = load i64, ptr %36, align 4, !dbg !24 + %56 = and i64 %55, %39, !dbg !24 + store i64 %56, ptr %36, align 4, !dbg !24 + %57 = load i64, ptr %42, align 4, !dbg !24 + %58 = and i64 %57, %46, !dbg !24 + store i64 %58, ptr %42, align 4, !dbg !24 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +59: ; preds = %mask_block_ok.i201 + %60 = add nuw i64 %.02.i202, 1, !dbg !24 + %exitcond.not.i205 = icmp eq i64 %.02.i202, %reass.sub.i190, !dbg !24 + br i1 %exitcond.not.i205, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +mask_block_ok.i201: ; preds = %__barray_check_none_borrowed.exit197, %59 + %.02.i202 = phi i64 [ %60, %59 ], [ 0, %__barray_check_none_borrowed.exit197 ], !dbg !23 + %gep.i203 = getelementptr i64, ptr %36, i64 %.02.i202, !dbg !24 + %61 = load i64, ptr %gep.i203, align 4, !dbg !24 + %62 = icmp eq i64 %61, 0, !dbg !24 + br i1 %62, label %59, label %mask_block_err.i204, !dbg !24 + +mask_block_err.i204: ; preds = %mask_block_ok.i201 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !24 + unreachable, !dbg !24 + +__barray_check_none_borrowed.exit206: ; preds = %59, %__barray_check_none_borrowed.exit197 + %63 = lshr i64 %.fca.2.extract165, 6, !dbg !26 + %64 = getelementptr i64, ptr %.fca.1.extract163, i64 %63, !dbg !26 + %65 = load i64, ptr %64, align 4, !dbg !26 + %66 = and i64 %.fca.2.extract165, 63, !dbg !26 + %67 = shl nsw i64 -1, %66, !dbg !26 + %68 = and i64 %65, %67, !dbg !26 + store i64 %68, ptr %64, align 4, !dbg !26 + %last_valid.i207 = add i64 %.fca.2.extract165, 4, !dbg !26 + %69 = lshr i64 %last_valid.i207, 6, !dbg !26 + %70 = getelementptr inbounds nuw i64, ptr %.fca.1.extract163, i64 %69, !dbg !26 + %71 = load i64, ptr %70, align 4, !dbg !26 + %72 = and i64 %last_valid.i207, 63, !dbg !26 + %73 = xor i64 %72, 63, !dbg !26 + %74 = lshr i64 -1, %73, !dbg !26 + %75 = and i64 %71, %74, !dbg !26 + store i64 %75, ptr %70, align 4, !dbg !26 + %reass.sub.i208 = sub nsw i64 %69, %63, !dbg !26 + %.not.i209 = icmp eq i64 %reass.sub.i208, -1, !dbg !26 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +76: ; preds = %mask_block_ok.i210 + %77 = add nuw i64 %.02.i211, 1, !dbg !26 + %exitcond.not.i214 = icmp eq i64 %.02.i211, %reass.sub.i208, !dbg !26 + br i1 %exitcond.not.i214, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +mask_block_ok.i210: ; preds = %__barray_check_none_borrowed.exit206, %76 + %.02.i211 = phi i64 [ %77, %76 ], [ 0, %__barray_check_none_borrowed.exit206 ], !dbg !28 + %gep.i212 = getelementptr i64, ptr %64, i64 %.02.i211, !dbg !26 + %78 = load i64, ptr %gep.i212, align 4, !dbg !26 + %79 = icmp eq i64 %78, 0, !dbg !26 + br i1 %79, label %76, label %mask_block_err.i213, !dbg !26 + +mask_block_err.i213: ; preds = %mask_block_ok.i210 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !26 + unreachable, !dbg !26 + +__barray_check_none_borrowed.exit215: ; preds = %76, %__barray_check_none_borrowed.exit206 + %80 = tail call ptr @heap_alloc(i64 40), !dbg !28 + %81 = tail call ptr @heap_alloc(i64 8), !dbg !28 + store i64 0, ptr %81, align 1, !dbg !28 + %82 = getelementptr inbounds i64, ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(40) %80, ptr noundef nonnull align 1 dereferenceable(40) %82, i64 40, i1 false), !dbg !28 + %83 = load i64, ptr %64, align 4, !dbg !29 + %84 = and i64 %83, %67, !dbg !29 + store i64 %84, ptr %64, align 4, !dbg !29 + %85 = load i64, ptr %70, align 4, !dbg !29 + %86 = and i64 %85, %74, !dbg !29 + store i64 %86, ptr %70, align 4, !dbg !29 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +87: ; preds = %mask_block_ok.i219 + %88 = add nuw i64 %.02.i220, 1, !dbg !29 + %exitcond.not.i223 = icmp eq i64 %.02.i220, %reass.sub.i208, !dbg !29 + br i1 %exitcond.not.i223, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +mask_block_ok.i219: ; preds = %__barray_check_none_borrowed.exit215, %87 + %.02.i220 = phi i64 [ %88, %87 ], [ 0, %__barray_check_none_borrowed.exit215 ], !dbg !28 + %gep.i221 = getelementptr i64, ptr %64, i64 %.02.i220, !dbg !29 + %89 = load i64, ptr %gep.i221, align 4, !dbg !29 + %90 = icmp eq i64 %89, 0, !dbg !29 + br i1 %90, label %87, label %mask_block_err.i222, !dbg !29 + +mask_block_err.i222: ; preds = %mask_block_ok.i219 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !29 + unreachable, !dbg !29 + +__barray_check_none_borrowed.exit224: ; preds = %87, %__barray_check_none_borrowed.exit215 + %91 = insertvalue { ptr, ptr, i64 } poison, ptr %80, 0, !dbg !28 + %92 = insertvalue { ptr, ptr, i64 } %91, ptr %81, 1, !dbg !28 + %93 = insertvalue { ptr, ptr, i64 } %92, i64 0, 2, !dbg !28 + %94 = insertvalue { ptr, ptr, i64 } poison, ptr %52, 0, !dbg !23 + %95 = insertvalue { ptr, ptr, i64 } %94, ptr %53, 1, !dbg !23 + %96 = insertvalue { ptr, ptr, i64 } %95, i64 0, 2, !dbg !23 + %97 = insertvalue { ptr, ptr, i64 } poison, ptr %23, 0, !dbg !18 + %98 = insertvalue { ptr, ptr, i64 } %97, ptr %24, 1, !dbg !18 + %99 = insertvalue { ptr, ptr, i64 } %98, i64 0, 2, !dbg !18 + tail call void @print_int(ptr nonnull @res_a.19FB4E83.0, i64 10, i64 %0), !dbg !31 + tail call void @print_float(ptr nonnull @res_b.0E048F9C.0, i64 12, double %1), !dbg !32 + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %2), !dbg !33 + %100 = getelementptr inbounds [5 x i64], ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !28 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4, !dbg !28 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8, !dbg !28 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16, !dbg !28 + %101 = alloca [5 x i1], align 1, !dbg !28 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %101, i8 0, i64 5, i1 false), !dbg !28 + store i32 5, ptr %out_arr_alloca, align 8, !dbg !28 + store i32 1, ptr %y_ptr, align 4, !dbg !28 + store ptr %100, ptr %arr_ptr, align 8, !dbg !28 + store ptr %101, ptr %mask_ptr, align 8, !dbg !28 + call void @print_int_arr(ptr nonnull @res_d.93EDD03A.0, i64 13, ptr nonnull %out_arr_alloca), !dbg !28 + %102 = getelementptr inbounds [3 x double], ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + %out_arr_alloca57 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !23 + %y_ptr59 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 4, !dbg !23 + %arr_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 8, !dbg !23 + %mask_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 16, !dbg !23 + %103 = alloca [3 x i1], align 1, !dbg !23 + store i1 false, ptr %103, align 1, !dbg !23 + %.repack171 = getelementptr inbounds nuw i8, ptr %103, i64 1, !dbg !23 + store i1 false, ptr %.repack171, align 1, !dbg !23 + %.repack172 = getelementptr inbounds nuw i8, ptr %103, i64 2, !dbg !23 + store i1 false, ptr %.repack172, align 1, !dbg !23 + store i32 3, ptr %out_arr_alloca57, align 8, !dbg !23 + store i32 1, ptr %y_ptr59, align 4, !dbg !23 + store ptr %102, ptr %arr_ptr60, align 8, !dbg !23 + store ptr %103, ptr %mask_ptr61, align 8, !dbg !23 + call void @print_float_arr(ptr nonnull @res_e.DB2DB1D9.0, i64 15, ptr nonnull %out_arr_alloca57), !dbg !23 + %104 = getelementptr inbounds [8 x i1], ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %out_arr_alloca67 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !18 + %y_ptr69 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 4, !dbg !18 + %arr_ptr70 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 8, !dbg !18 + %mask_ptr71 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 16, !dbg !18 + %105 = alloca [8 x i1], align 8, !dbg !18 + store i64 0, ptr %105, align 8, !dbg !18 + store i32 8, ptr %out_arr_alloca67, align 8, !dbg !18 + store i32 1, ptr %y_ptr69, align 4, !dbg !18 + store ptr %104, ptr %arr_ptr70, align 8, !dbg !18 + store ptr %105, ptr %mask_ptr71, align 8, !dbg !18 + call void @print_bool_arr(ptr nonnull @res_f.173699F1.0, i64 14, ptr nonnull %out_arr_alloca67), !dbg !18 + %mrv = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } poison, { ptr, ptr, i64 } %93, 0 + %mrv89 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv, { ptr, ptr, i64 } %96, 1 + %mrv90 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv89, { ptr, ptr, i64 } %99, 2 + ret { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv90 +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #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 @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_float(ptr, i64, double) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) 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 @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @argreader_get_bool_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_f64_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_i64_array(ptr, ptr, i64) local_unnamed_addr + +declare i1 @argreader_get_bool(ptr) local_unnamed_addr + +declare double @argreader_get_f64(ptr) local_unnamed_addr + +declare i64 @argreader_get_i64(ptr) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !34 { +entry: + tail call void @setup(i64 %0), !dbg !38 + %1 = tail call ptr @heap_alloc(i64 8), !dbg !38 + %2 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %2, align 1, !dbg !38 + %3 = insertvalue { ptr, ptr, i64 } poison, ptr %1, 0, !dbg !38 + %4 = insertvalue { ptr, ptr, i64 } %3, ptr %2, 1, !dbg !38 + %5 = insertvalue { ptr, ptr, i64 } %4, i64 0, 2, !dbg !38 + tail call void @argreader_get_bool_array(ptr nonnull @argument_arg_5.E3E8C60E.0, ptr %1, i64 8), !dbg !38 + %6 = tail call ptr @heap_alloc(i64 24), !dbg !38 + %7 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %7, align 1, !dbg !38 + %8 = insertvalue { ptr, ptr, i64 } poison, ptr %6, 0, !dbg !38 + %9 = insertvalue { ptr, ptr, i64 } %8, ptr %7, 1, !dbg !38 + %10 = insertvalue { ptr, ptr, i64 } %9, i64 0, 2, !dbg !38 + tail call void @argreader_get_f64_array(ptr nonnull @argument_arg_4.43DB6CC9.0, ptr %6, i64 3), !dbg !38 + %11 = tail call ptr @heap_alloc(i64 40), !dbg !38 + %12 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %12, align 1, !dbg !38 + %13 = insertvalue { ptr, ptr, i64 } poison, ptr %11, 0, !dbg !38 + %14 = insertvalue { ptr, ptr, i64 } %13, ptr %12, 1, !dbg !38 + %15 = insertvalue { ptr, ptr, i64 } %14, i64 0, 2, !dbg !38 + tail call void @argreader_get_i64_array(ptr nonnull @argument_arg_3.E6500947.0, ptr %11, i64 5), !dbg !38 + %read_arg_bool.i = tail call i1 @argreader_get_bool(ptr nonnull @argument_arg_2.32BF8FD7.0), !dbg !38 + %read_arg_f64.i = tail call double @argreader_get_f64(ptr nonnull @argument_arg_1.12764F87.0), !dbg !38 + %read_arg_int.i = tail call i64 @argreader_get_i64(ptr nonnull @argument_arg_0.0A040DE9.0), !dbg !38 + %16 = tail call { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %read_arg_int.i, double %read_arg_f64.i, i1 %read_arg_bool.i, { ptr, ptr, i64 } %15, { ptr, ptr, i64 } %10, { ptr, ptr, i64 } %5), !dbg !38 + %17 = tail call i64 @teardown(), !dbg !38 + ret i64 %17, !dbg !38 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } +attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } + +!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.0-a3)-v1.0.0-a3", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "entry_args..foo", linkageName: "__hugr__.__main__.entry_args..foo.1", scope: null, file: !5, line: 247, type: !6, scopeLine: 248, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!6 = !DISubroutineType(types: !7) +!7 = !{!8, !13, !14, !15, !10, !10, !10} +!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } }", file: !2, size: 576, align: 8, elements: !9) +!9 = !{!10, !10, !10} +!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !11) +!11 = !{!12, !12, !13} +!12 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DIBasicType(name: "f64", size: 64, encoding: DW_ATE_float) +!15 = !DIBasicType(name: "i1", size: 1, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !17) +!17 = distinct !DILocation(line: 253, column: 8, scope: !4) +!18 = !DILocation(line: 253, column: 8, scope: !4) +!19 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !20) +!20 = distinct !DILocation(line: 253, column: 8, scope: !4) +!21 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !22) +!22 = distinct !DILocation(line: 252, column: 8, scope: !4) +!23 = !DILocation(line: 252, column: 8, scope: !4) +!24 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !25) +!25 = distinct !DILocation(line: 252, column: 8, scope: !4) +!26 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !27) +!27 = distinct !DILocation(line: 251, column: 8, scope: !4) +!28 = !DILocation(line: 251, column: 8, scope: !4) +!29 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !30) +!30 = distinct !DILocation(line: 251, column: 8, scope: !4) +!31 = !DILocation(line: 248, column: 8, scope: !4) +!32 = !DILocation(line: 249, column: 8, scope: !4) +!33 = !DILocation(line: 250, column: 8, scope: !4) +!34 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !35, type: !36, spFlags: DISPFlagDefinition, unit: !1) +!35 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!36 = !DISubroutineType(types: !37) +!37 = !{!13, !13} +!38 = !DILocation(line: 0, scope: !34) \ No newline at end of file diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol index 208637887..ab374bea8 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37, !dbg !10 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41, !dbg !11 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45, !dbg !13 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol index b79205d77..4caae10f3 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol @@ -15,9 +15,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i - %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6, !dbg !72 - %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136, !dbg !72 +cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i + %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6, !dbg !72 + %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136, !dbg !72 %138 = load i64, ptr %137, align 4, !dbg !72 - %139 = and i64 %"421_1.sroa.10.0.i.i", 63, !dbg !72 + %139 = and i64 %"425_1.sroa.10.0.i.i", 63, !dbg !72 %140 = sub nuw nsw i64 64, %139, !dbg !72 %141 = lshr i64 -1, %140, !dbg !72 %142 = icmp eq i64 %139, 0, !dbg !72 %143 = select i1 %142, i64 0, i64 %141, !dbg !72 %144 = or i64 %138, %143, !dbg !72 store i64 %144, ptr %137, align 4, !dbg !72 - %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9, !dbg !72 + %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9, !dbg !72 %145 = lshr i64 %last_valid.i.i.i179, 6, !dbg !72 - %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145, !dbg !72 + %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145, !dbg !72 %147 = load i64, ptr %146, align 4, !dbg !72 %148 = and i64 %last_valid.i.i.i179, 63, !dbg !72 %149 = shl nsw i64 -2, %148, !dbg !72 @@ -474,8 +474,8 @@ cond_424_case_0.i.i: ; preds = %cond_exit_424.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180, !dbg !72 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182, !dbg !72 -mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183, !dbg !72 %155 = load i64, ptr %gep.i.i.i184, align 4, !dbg !72 %156 = icmp eq i64 %155, -1, !dbg !72 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0"), !dbg !72 unreachable, !dbg !72 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i - %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] - %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 - %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i + %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] + %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 + %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %165, %161, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol index 066aa9e13..3f4ac4f6e 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit, !dbg !8 -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol index 33f773d90..1051c04c0 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit, !dbg !8 -cond_44_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"), !dbg !8 unreachable, !dbg !8 -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol index 24a5a695b..8eecfb815 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit, !dbg !8 -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.38.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.42.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol index f778f2dd0..a289e68a7 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 + %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol index bf434b8d5..9a241c067 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit, !dbg !8 -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] +__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i, !dbg !15 -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol index c2fe49921..3a2218ef8 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol @@ -14,9 +14,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_225_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_229_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-entry_args/entry_args_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-entry_args/entry_args_x86_64-unknown-linux-gnu_sol new file mode 100644 index 000000000..0df579389 --- /dev/null +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-entry_args/entry_args_x86_64-unknown-linux-gnu_sol @@ -0,0 +1,408 @@ +; 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_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_a.19FB4E83.0 = private constant [11 x i8] c"\0AUSER:INT:a" +@res_b.0E048F9C.0 = private constant [13 x i8] c"\0CUSER:FLOAT:b" +@res_c.1C9EF4D1.0 = private constant [12 x i8] c"\0BUSER:BOOL:c" +@res_d.93EDD03A.0 = private constant [14 x i8] c"\0DUSER:INTARR:d" +@res_e.DB2DB1D9.0 = private constant [16 x i8] c"\0FUSER:FLOATARR:e" +@res_f.173699F1.0 = private constant [15 x i8] c"\0EUSER:BOOLARR:f" +@argument_arg_5.E3E8C60E.0 = private constant [6 x i8] c"\05arg_5" +@argument_arg_4.43DB6CC9.0 = private constant [6 x i8] c"\05arg_4" +@argument_arg_3.E6500947.0 = private constant [6 x i8] c"\05arg_3" +@argument_arg_2.32BF8FD7.0 = private constant [6 x i8] c"\05arg_2" +@argument_arg_1.12764F87.0 = private constant [6 x i8] c"\05arg_1" +@argument_arg_0.0A040DE9.0 = private constant [6 x i8] c"\05arg_0" + +define { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %0, double %1, i1 %2, { ptr, ptr, i64 } %3, { ptr, ptr, i64 } %4, { ptr, ptr, i64 } %5) local_unnamed_addr !dbg !4 { +alloca_block: + %.fca.0.extract161 = extractvalue { ptr, ptr, i64 } %3, 0 + %.fca.1.extract163 = extractvalue { ptr, ptr, i64 } %3, 1 + %.fca.2.extract165 = extractvalue { ptr, ptr, i64 } %3, 2 + %.fca.0.extract155 = extractvalue { ptr, ptr, i64 } %4, 0 + %.fca.1.extract157 = extractvalue { ptr, ptr, i64 } %4, 1 + %.fca.2.extract159 = extractvalue { ptr, ptr, i64 } %4, 2 + %.fca.0.extract149 = extractvalue { ptr, ptr, i64 } %5, 0 + %.fca.1.extract151 = extractvalue { ptr, ptr, i64 } %5, 1 + %.fca.2.extract153 = extractvalue { ptr, ptr, i64 } %5, 2 + %6 = lshr i64 %.fca.2.extract153, 6, !dbg !16 + %7 = getelementptr i64, ptr %.fca.1.extract151, i64 %6, !dbg !16 + %8 = load i64, ptr %7, align 4, !dbg !16 + %9 = and i64 %.fca.2.extract153, 63, !dbg !16 + %10 = shl nsw i64 -1, %9, !dbg !16 + %11 = and i64 %8, %10, !dbg !16 + store i64 %11, ptr %7, align 4, !dbg !16 + %last_valid.i = add i64 %.fca.2.extract153, 7, !dbg !16 + %12 = lshr i64 %last_valid.i, 6, !dbg !16 + %13 = getelementptr inbounds nuw i64, ptr %.fca.1.extract151, i64 %12, !dbg !16 + %14 = load i64, ptr %13, align 4, !dbg !16 + %15 = and i64 %last_valid.i, 63, !dbg !16 + %16 = xor i64 %15, 63, !dbg !16 + %17 = lshr i64 -1, %16, !dbg !16 + %18 = and i64 %14, %17, !dbg !16 + store i64 %18, ptr %13, align 4, !dbg !16 + %reass.sub.i = sub nsw i64 %12, %6, !dbg !16 + %.not.i = icmp eq i64 %reass.sub.i, -1, !dbg !16 + br i1 %.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +19: ; preds = %mask_block_ok.i + %20 = add nuw i64 %.02.i, 1, !dbg !16 + %exitcond.not.i = icmp eq i64 %.02.i, %reass.sub.i, !dbg !16 + br i1 %exitcond.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +mask_block_ok.i: ; preds = %alloca_block, %19 + %.02.i = phi i64 [ %20, %19 ], [ 0, %alloca_block ], !dbg !18 + %gep.i = getelementptr i64, ptr %7, i64 %.02.i, !dbg !16 + %21 = load i64, ptr %gep.i, align 4, !dbg !16 + %22 = icmp eq i64 %21, 0, !dbg !16 + br i1 %22, label %19, label %mask_block_err.i, !dbg !16 + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !16 + unreachable, !dbg !16 + +__barray_check_none_borrowed.exit: ; preds = %19, %alloca_block + %23 = tail call ptr @heap_alloc(i64 8), !dbg !18 + %24 = tail call ptr @heap_alloc(i64 8), !dbg !18 + store i64 0, ptr %24, align 1, !dbg !18 + %25 = getelementptr inbounds i1, ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %26 = load i64, ptr %25, align 1, !dbg !18 + store i64 %26, ptr %23, align 1, !dbg !18 + %27 = load i64, ptr %7, align 4, !dbg !19 + %28 = and i64 %27, %10, !dbg !19 + store i64 %28, ptr %7, align 4, !dbg !19 + %29 = load i64, ptr %13, align 4, !dbg !19 + %30 = and i64 %29, %17, !dbg !19 + store i64 %30, ptr %13, align 4, !dbg !19 + br i1 %.not.i, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +31: ; preds = %mask_block_ok.i183 + %32 = add nuw i64 %.02.i184, 1, !dbg !19 + %exitcond.not.i187 = icmp eq i64 %.02.i184, %reass.sub.i, !dbg !19 + br i1 %exitcond.not.i187, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +mask_block_ok.i183: ; preds = %__barray_check_none_borrowed.exit, %31 + %.02.i184 = phi i64 [ %32, %31 ], [ 0, %__barray_check_none_borrowed.exit ], !dbg !18 + %gep.i185 = getelementptr i64, ptr %7, i64 %.02.i184, !dbg !19 + %33 = load i64, ptr %gep.i185, align 4, !dbg !19 + %34 = icmp eq i64 %33, 0, !dbg !19 + br i1 %34, label %31, label %mask_block_err.i186, !dbg !19 + +mask_block_err.i186: ; preds = %mask_block_ok.i183 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !19 + unreachable, !dbg !19 + +__barray_check_none_borrowed.exit188: ; preds = %31, %__barray_check_none_borrowed.exit + %35 = lshr i64 %.fca.2.extract159, 6, !dbg !21 + %36 = getelementptr i64, ptr %.fca.1.extract157, i64 %35, !dbg !21 + %37 = load i64, ptr %36, align 4, !dbg !21 + %38 = and i64 %.fca.2.extract159, 63, !dbg !21 + %39 = shl nsw i64 -1, %38, !dbg !21 + %40 = and i64 %37, %39, !dbg !21 + store i64 %40, ptr %36, align 4, !dbg !21 + %last_valid.i189 = add i64 %.fca.2.extract159, 2, !dbg !21 + %41 = lshr i64 %last_valid.i189, 6, !dbg !21 + %42 = getelementptr inbounds nuw i64, ptr %.fca.1.extract157, i64 %41, !dbg !21 + %43 = load i64, ptr %42, align 4, !dbg !21 + %44 = and i64 %last_valid.i189, 63, !dbg !21 + %45 = xor i64 %44, 63, !dbg !21 + %46 = lshr i64 -1, %45, !dbg !21 + %47 = and i64 %43, %46, !dbg !21 + store i64 %47, ptr %42, align 4, !dbg !21 + %reass.sub.i190 = sub nsw i64 %41, %35, !dbg !21 + %.not.i191 = icmp eq i64 %reass.sub.i190, -1, !dbg !21 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +48: ; preds = %mask_block_ok.i192 + %49 = add nuw i64 %.02.i193, 1, !dbg !21 + %exitcond.not.i196 = icmp eq i64 %.02.i193, %reass.sub.i190, !dbg !21 + br i1 %exitcond.not.i196, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +mask_block_ok.i192: ; preds = %__barray_check_none_borrowed.exit188, %48 + %.02.i193 = phi i64 [ %49, %48 ], [ 0, %__barray_check_none_borrowed.exit188 ], !dbg !23 + %gep.i194 = getelementptr i64, ptr %36, i64 %.02.i193, !dbg !21 + %50 = load i64, ptr %gep.i194, align 4, !dbg !21 + %51 = icmp eq i64 %50, 0, !dbg !21 + br i1 %51, label %48, label %mask_block_err.i195, !dbg !21 + +mask_block_err.i195: ; preds = %mask_block_ok.i192 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !21 + unreachable, !dbg !21 + +__barray_check_none_borrowed.exit197: ; preds = %48, %__barray_check_none_borrowed.exit188 + %52 = tail call ptr @heap_alloc(i64 24), !dbg !23 + %53 = tail call ptr @heap_alloc(i64 8), !dbg !23 + store i64 0, ptr %53, align 1, !dbg !23 + %54 = getelementptr inbounds double, ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(24) %52, ptr noundef nonnull align 1 dereferenceable(24) %54, i64 24, i1 false), !dbg !23 + %55 = load i64, ptr %36, align 4, !dbg !24 + %56 = and i64 %55, %39, !dbg !24 + store i64 %56, ptr %36, align 4, !dbg !24 + %57 = load i64, ptr %42, align 4, !dbg !24 + %58 = and i64 %57, %46, !dbg !24 + store i64 %58, ptr %42, align 4, !dbg !24 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +59: ; preds = %mask_block_ok.i201 + %60 = add nuw i64 %.02.i202, 1, !dbg !24 + %exitcond.not.i205 = icmp eq i64 %.02.i202, %reass.sub.i190, !dbg !24 + br i1 %exitcond.not.i205, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +mask_block_ok.i201: ; preds = %__barray_check_none_borrowed.exit197, %59 + %.02.i202 = phi i64 [ %60, %59 ], [ 0, %__barray_check_none_borrowed.exit197 ], !dbg !23 + %gep.i203 = getelementptr i64, ptr %36, i64 %.02.i202, !dbg !24 + %61 = load i64, ptr %gep.i203, align 4, !dbg !24 + %62 = icmp eq i64 %61, 0, !dbg !24 + br i1 %62, label %59, label %mask_block_err.i204, !dbg !24 + +mask_block_err.i204: ; preds = %mask_block_ok.i201 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !24 + unreachable, !dbg !24 + +__barray_check_none_borrowed.exit206: ; preds = %59, %__barray_check_none_borrowed.exit197 + %63 = lshr i64 %.fca.2.extract165, 6, !dbg !26 + %64 = getelementptr i64, ptr %.fca.1.extract163, i64 %63, !dbg !26 + %65 = load i64, ptr %64, align 4, !dbg !26 + %66 = and i64 %.fca.2.extract165, 63, !dbg !26 + %67 = shl nsw i64 -1, %66, !dbg !26 + %68 = and i64 %65, %67, !dbg !26 + store i64 %68, ptr %64, align 4, !dbg !26 + %last_valid.i207 = add i64 %.fca.2.extract165, 4, !dbg !26 + %69 = lshr i64 %last_valid.i207, 6, !dbg !26 + %70 = getelementptr inbounds nuw i64, ptr %.fca.1.extract163, i64 %69, !dbg !26 + %71 = load i64, ptr %70, align 4, !dbg !26 + %72 = and i64 %last_valid.i207, 63, !dbg !26 + %73 = xor i64 %72, 63, !dbg !26 + %74 = lshr i64 -1, %73, !dbg !26 + %75 = and i64 %71, %74, !dbg !26 + store i64 %75, ptr %70, align 4, !dbg !26 + %reass.sub.i208 = sub nsw i64 %69, %63, !dbg !26 + %.not.i209 = icmp eq i64 %reass.sub.i208, -1, !dbg !26 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +76: ; preds = %mask_block_ok.i210 + %77 = add nuw i64 %.02.i211, 1, !dbg !26 + %exitcond.not.i214 = icmp eq i64 %.02.i211, %reass.sub.i208, !dbg !26 + br i1 %exitcond.not.i214, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +mask_block_ok.i210: ; preds = %__barray_check_none_borrowed.exit206, %76 + %.02.i211 = phi i64 [ %77, %76 ], [ 0, %__barray_check_none_borrowed.exit206 ], !dbg !28 + %gep.i212 = getelementptr i64, ptr %64, i64 %.02.i211, !dbg !26 + %78 = load i64, ptr %gep.i212, align 4, !dbg !26 + %79 = icmp eq i64 %78, 0, !dbg !26 + br i1 %79, label %76, label %mask_block_err.i213, !dbg !26 + +mask_block_err.i213: ; preds = %mask_block_ok.i210 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !26 + unreachable, !dbg !26 + +__barray_check_none_borrowed.exit215: ; preds = %76, %__barray_check_none_borrowed.exit206 + %80 = tail call ptr @heap_alloc(i64 40), !dbg !28 + %81 = tail call ptr @heap_alloc(i64 8), !dbg !28 + store i64 0, ptr %81, align 1, !dbg !28 + %82 = getelementptr inbounds i64, ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(40) %80, ptr noundef nonnull align 1 dereferenceable(40) %82, i64 40, i1 false), !dbg !28 + %83 = load i64, ptr %64, align 4, !dbg !29 + %84 = and i64 %83, %67, !dbg !29 + store i64 %84, ptr %64, align 4, !dbg !29 + %85 = load i64, ptr %70, align 4, !dbg !29 + %86 = and i64 %85, %74, !dbg !29 + store i64 %86, ptr %70, align 4, !dbg !29 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +87: ; preds = %mask_block_ok.i219 + %88 = add nuw i64 %.02.i220, 1, !dbg !29 + %exitcond.not.i223 = icmp eq i64 %.02.i220, %reass.sub.i208, !dbg !29 + br i1 %exitcond.not.i223, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +mask_block_ok.i219: ; preds = %__barray_check_none_borrowed.exit215, %87 + %.02.i220 = phi i64 [ %88, %87 ], [ 0, %__barray_check_none_borrowed.exit215 ], !dbg !28 + %gep.i221 = getelementptr i64, ptr %64, i64 %.02.i220, !dbg !29 + %89 = load i64, ptr %gep.i221, align 4, !dbg !29 + %90 = icmp eq i64 %89, 0, !dbg !29 + br i1 %90, label %87, label %mask_block_err.i222, !dbg !29 + +mask_block_err.i222: ; preds = %mask_block_ok.i219 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !29 + unreachable, !dbg !29 + +__barray_check_none_borrowed.exit224: ; preds = %87, %__barray_check_none_borrowed.exit215 + %91 = insertvalue { ptr, ptr, i64 } poison, ptr %80, 0, !dbg !28 + %92 = insertvalue { ptr, ptr, i64 } %91, ptr %81, 1, !dbg !28 + %93 = insertvalue { ptr, ptr, i64 } %92, i64 0, 2, !dbg !28 + %94 = insertvalue { ptr, ptr, i64 } poison, ptr %52, 0, !dbg !23 + %95 = insertvalue { ptr, ptr, i64 } %94, ptr %53, 1, !dbg !23 + %96 = insertvalue { ptr, ptr, i64 } %95, i64 0, 2, !dbg !23 + %97 = insertvalue { ptr, ptr, i64 } poison, ptr %23, 0, !dbg !18 + %98 = insertvalue { ptr, ptr, i64 } %97, ptr %24, 1, !dbg !18 + %99 = insertvalue { ptr, ptr, i64 } %98, i64 0, 2, !dbg !18 + tail call void @print_int(ptr nonnull @res_a.19FB4E83.0, i64 10, i64 %0), !dbg !31 + tail call void @print_float(ptr nonnull @res_b.0E048F9C.0, i64 12, double %1), !dbg !32 + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %2), !dbg !33 + %100 = getelementptr inbounds [5 x i64], ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !28 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4, !dbg !28 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8, !dbg !28 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16, !dbg !28 + %101 = alloca [5 x i1], align 1, !dbg !28 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %101, i8 0, i64 5, i1 false), !dbg !28 + store i32 5, ptr %out_arr_alloca, align 8, !dbg !28 + store i32 1, ptr %y_ptr, align 4, !dbg !28 + store ptr %100, ptr %arr_ptr, align 8, !dbg !28 + store ptr %101, ptr %mask_ptr, align 8, !dbg !28 + call void @print_int_arr(ptr nonnull @res_d.93EDD03A.0, i64 13, ptr nonnull %out_arr_alloca), !dbg !28 + %102 = getelementptr inbounds [3 x double], ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + %out_arr_alloca57 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !23 + %y_ptr59 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 4, !dbg !23 + %arr_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 8, !dbg !23 + %mask_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 16, !dbg !23 + %103 = alloca [3 x i1], align 1, !dbg !23 + store i1 false, ptr %103, align 1, !dbg !23 + %.repack171 = getelementptr inbounds nuw i8, ptr %103, i64 1, !dbg !23 + store i1 false, ptr %.repack171, align 1, !dbg !23 + %.repack172 = getelementptr inbounds nuw i8, ptr %103, i64 2, !dbg !23 + store i1 false, ptr %.repack172, align 1, !dbg !23 + store i32 3, ptr %out_arr_alloca57, align 8, !dbg !23 + store i32 1, ptr %y_ptr59, align 4, !dbg !23 + store ptr %102, ptr %arr_ptr60, align 8, !dbg !23 + store ptr %103, ptr %mask_ptr61, align 8, !dbg !23 + call void @print_float_arr(ptr nonnull @res_e.DB2DB1D9.0, i64 15, ptr nonnull %out_arr_alloca57), !dbg !23 + %104 = getelementptr inbounds [8 x i1], ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %out_arr_alloca67 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !18 + %y_ptr69 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 4, !dbg !18 + %arr_ptr70 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 8, !dbg !18 + %mask_ptr71 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 16, !dbg !18 + %105 = alloca [8 x i1], align 8, !dbg !18 + store i64 0, ptr %105, align 8, !dbg !18 + store i32 8, ptr %out_arr_alloca67, align 8, !dbg !18 + store i32 1, ptr %y_ptr69, align 4, !dbg !18 + store ptr %104, ptr %arr_ptr70, align 8, !dbg !18 + store ptr %105, ptr %mask_ptr71, align 8, !dbg !18 + call void @print_bool_arr(ptr nonnull @res_f.173699F1.0, i64 14, ptr nonnull %out_arr_alloca67), !dbg !18 + %mrv = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } poison, { ptr, ptr, i64 } %93, 0 + %mrv89 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv, { ptr, ptr, i64 } %96, 1 + %mrv90 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv89, { ptr, ptr, i64 } %99, 2 + ret { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv90 +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #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 @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_float(ptr, i64, double) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) 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 @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @argreader_get_bool_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_f64_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_i64_array(ptr, ptr, i64) local_unnamed_addr + +declare i1 @argreader_get_bool(ptr) local_unnamed_addr + +declare double @argreader_get_f64(ptr) local_unnamed_addr + +declare i64 @argreader_get_i64(ptr) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !34 { +entry: + tail call void @setup(i64 %0), !dbg !38 + %1 = tail call ptr @heap_alloc(i64 8), !dbg !38 + %2 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %2, align 1, !dbg !38 + %3 = insertvalue { ptr, ptr, i64 } poison, ptr %1, 0, !dbg !38 + %4 = insertvalue { ptr, ptr, i64 } %3, ptr %2, 1, !dbg !38 + %5 = insertvalue { ptr, ptr, i64 } %4, i64 0, 2, !dbg !38 + tail call void @argreader_get_bool_array(ptr nonnull @argument_arg_5.E3E8C60E.0, ptr %1, i64 8), !dbg !38 + %6 = tail call ptr @heap_alloc(i64 24), !dbg !38 + %7 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %7, align 1, !dbg !38 + %8 = insertvalue { ptr, ptr, i64 } poison, ptr %6, 0, !dbg !38 + %9 = insertvalue { ptr, ptr, i64 } %8, ptr %7, 1, !dbg !38 + %10 = insertvalue { ptr, ptr, i64 } %9, i64 0, 2, !dbg !38 + tail call void @argreader_get_f64_array(ptr nonnull @argument_arg_4.43DB6CC9.0, ptr %6, i64 3), !dbg !38 + %11 = tail call ptr @heap_alloc(i64 40), !dbg !38 + %12 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %12, align 1, !dbg !38 + %13 = insertvalue { ptr, ptr, i64 } poison, ptr %11, 0, !dbg !38 + %14 = insertvalue { ptr, ptr, i64 } %13, ptr %12, 1, !dbg !38 + %15 = insertvalue { ptr, ptr, i64 } %14, i64 0, 2, !dbg !38 + tail call void @argreader_get_i64_array(ptr nonnull @argument_arg_3.E6500947.0, ptr %11, i64 5), !dbg !38 + %read_arg_bool.i = tail call i1 @argreader_get_bool(ptr nonnull @argument_arg_2.32BF8FD7.0), !dbg !38 + %read_arg_f64.i = tail call double @argreader_get_f64(ptr nonnull @argument_arg_1.12764F87.0), !dbg !38 + %read_arg_int.i = tail call i64 @argreader_get_i64(ptr nonnull @argument_arg_0.0A040DE9.0), !dbg !38 + %16 = tail call { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %read_arg_int.i, double %read_arg_f64.i, i1 %read_arg_bool.i, { ptr, ptr, i64 } %15, { ptr, ptr, i64 } %10, { ptr, ptr, i64 } %5), !dbg !38 + %17 = tail call i64 @teardown(), !dbg !38 + ret i64 %17, !dbg !38 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } +attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } + +!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.0-a3)-v1.0.0-a3", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "entry_args..foo", linkageName: "__hugr__.__main__.entry_args..foo.1", scope: null, file: !5, line: 247, type: !6, scopeLine: 248, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!6 = !DISubroutineType(types: !7) +!7 = !{!8, !13, !14, !15, !10, !10, !10} +!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } }", file: !2, size: 576, align: 8, elements: !9) +!9 = !{!10, !10, !10} +!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !11) +!11 = !{!12, !12, !13} +!12 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DIBasicType(name: "f64", size: 64, encoding: DW_ATE_float) +!15 = !DIBasicType(name: "i1", size: 1, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !17) +!17 = distinct !DILocation(line: 253, column: 8, scope: !4) +!18 = !DILocation(line: 253, column: 8, scope: !4) +!19 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !20) +!20 = distinct !DILocation(line: 253, column: 8, scope: !4) +!21 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !22) +!22 = distinct !DILocation(line: 252, column: 8, scope: !4) +!23 = !DILocation(line: 252, column: 8, scope: !4) +!24 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !25) +!25 = distinct !DILocation(line: 252, column: 8, scope: !4) +!26 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !27) +!27 = distinct !DILocation(line: 251, column: 8, scope: !4) +!28 = !DILocation(line: 251, column: 8, scope: !4) +!29 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !30) +!30 = distinct !DILocation(line: 251, column: 8, scope: !4) +!31 = !DILocation(line: 248, column: 8, scope: !4) +!32 = !DILocation(line: 249, column: 8, scope: !4) +!33 = !DILocation(line: 250, column: 8, scope: !4) +!34 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !35, type: !36, spFlags: DISPFlagDefinition, unit: !1) +!35 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!36 = !DISubroutineType(types: !37) +!37 = !{!13, !13} +!38 = !DILocation(line: 0, scope: !34) \ No newline at end of file diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol index f643fd53f..70d9e4b25 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37, !dbg !10 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41, !dbg !11 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45, !dbg !13 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol index df93cb621..22adec2b4 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol @@ -15,9 +15,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i - %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6, !dbg !72 - %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136, !dbg !72 +cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i + %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6, !dbg !72 + %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136, !dbg !72 %138 = load i64, ptr %137, align 4, !dbg !72 - %139 = and i64 %"421_1.sroa.10.0.i.i", 63, !dbg !72 + %139 = and i64 %"425_1.sroa.10.0.i.i", 63, !dbg !72 %140 = sub nuw nsw i64 64, %139, !dbg !72 %141 = lshr i64 -1, %140, !dbg !72 %142 = icmp eq i64 %139, 0, !dbg !72 %143 = select i1 %142, i64 0, i64 %141, !dbg !72 %144 = or i64 %138, %143, !dbg !72 store i64 %144, ptr %137, align 4, !dbg !72 - %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9, !dbg !72 + %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9, !dbg !72 %145 = lshr i64 %last_valid.i.i.i179, 6, !dbg !72 - %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145, !dbg !72 + %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145, !dbg !72 %147 = load i64, ptr %146, align 4, !dbg !72 %148 = and i64 %last_valid.i.i.i179, 63, !dbg !72 %149 = shl nsw i64 -2, %148, !dbg !72 @@ -474,8 +474,8 @@ cond_424_case_0.i.i: ; preds = %cond_exit_424.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180, !dbg !72 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182, !dbg !72 -mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183, !dbg !72 %155 = load i64, ptr %gep.i.i.i184, align 4, !dbg !72 %156 = icmp eq i64 %155, -1, !dbg !72 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0"), !dbg !72 unreachable, !dbg !72 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i - %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] - %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 - %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i + %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] + %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 + %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %165, %161, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol index c765e9a57..643441c6c 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit, !dbg !8 -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol index fbdf07204..c1ad73446 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit, !dbg !8 -cond_44_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"), !dbg !8 unreachable, !dbg !8 -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol index a78b11e0f..7dcee3a4f 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit, !dbg !8 -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.38.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.42.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol index 60e63f416..f17bfa910 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 + %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol index be36f3414..7ba892671 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit, !dbg !8 -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] +__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i, !dbg !15 -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol index e589051cc..25f3acf19 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol @@ -14,9 +14,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_225_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_229_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-entry_args/entry_args_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-entry_args/entry_args_x86_64-windows-msvc_sol new file mode 100644 index 000000000..c4e37933b --- /dev/null +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-entry_args/entry_args_x86_64-windows-msvc_sol @@ -0,0 +1,408 @@ +; 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-msvc" + +@"e_Some array.A77EF32E.0" = private constant [48 x i8] c"/EXIT:INT:Some array elements have been borrowed" +@res_a.19FB4E83.0 = private constant [11 x i8] c"\0AUSER:INT:a" +@res_b.0E048F9C.0 = private constant [13 x i8] c"\0CUSER:FLOAT:b" +@res_c.1C9EF4D1.0 = private constant [12 x i8] c"\0BUSER:BOOL:c" +@res_d.93EDD03A.0 = private constant [14 x i8] c"\0DUSER:INTARR:d" +@res_e.DB2DB1D9.0 = private constant [16 x i8] c"\0FUSER:FLOATARR:e" +@res_f.173699F1.0 = private constant [15 x i8] c"\0EUSER:BOOLARR:f" +@argument_arg_5.E3E8C60E.0 = private constant [6 x i8] c"\05arg_5" +@argument_arg_4.43DB6CC9.0 = private constant [6 x i8] c"\05arg_4" +@argument_arg_3.E6500947.0 = private constant [6 x i8] c"\05arg_3" +@argument_arg_2.32BF8FD7.0 = private constant [6 x i8] c"\05arg_2" +@argument_arg_1.12764F87.0 = private constant [6 x i8] c"\05arg_1" +@argument_arg_0.0A040DE9.0 = private constant [6 x i8] c"\05arg_0" + +define { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %0, double %1, i1 %2, { ptr, ptr, i64 } %3, { ptr, ptr, i64 } %4, { ptr, ptr, i64 } %5) local_unnamed_addr !dbg !4 { +alloca_block: + %.fca.0.extract161 = extractvalue { ptr, ptr, i64 } %3, 0 + %.fca.1.extract163 = extractvalue { ptr, ptr, i64 } %3, 1 + %.fca.2.extract165 = extractvalue { ptr, ptr, i64 } %3, 2 + %.fca.0.extract155 = extractvalue { ptr, ptr, i64 } %4, 0 + %.fca.1.extract157 = extractvalue { ptr, ptr, i64 } %4, 1 + %.fca.2.extract159 = extractvalue { ptr, ptr, i64 } %4, 2 + %.fca.0.extract149 = extractvalue { ptr, ptr, i64 } %5, 0 + %.fca.1.extract151 = extractvalue { ptr, ptr, i64 } %5, 1 + %.fca.2.extract153 = extractvalue { ptr, ptr, i64 } %5, 2 + %6 = lshr i64 %.fca.2.extract153, 6, !dbg !16 + %7 = getelementptr i64, ptr %.fca.1.extract151, i64 %6, !dbg !16 + %8 = load i64, ptr %7, align 4, !dbg !16 + %9 = and i64 %.fca.2.extract153, 63, !dbg !16 + %10 = shl nsw i64 -1, %9, !dbg !16 + %11 = and i64 %8, %10, !dbg !16 + store i64 %11, ptr %7, align 4, !dbg !16 + %last_valid.i = add i64 %.fca.2.extract153, 7, !dbg !16 + %12 = lshr i64 %last_valid.i, 6, !dbg !16 + %13 = getelementptr inbounds nuw i64, ptr %.fca.1.extract151, i64 %12, !dbg !16 + %14 = load i64, ptr %13, align 4, !dbg !16 + %15 = and i64 %last_valid.i, 63, !dbg !16 + %16 = xor i64 %15, 63, !dbg !16 + %17 = lshr i64 -1, %16, !dbg !16 + %18 = and i64 %14, %17, !dbg !16 + store i64 %18, ptr %13, align 4, !dbg !16 + %reass.sub.i = sub nsw i64 %12, %6, !dbg !16 + %.not.i = icmp eq i64 %reass.sub.i, -1, !dbg !16 + br i1 %.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +19: ; preds = %mask_block_ok.i + %20 = add nuw i64 %.02.i, 1, !dbg !16 + %exitcond.not.i = icmp eq i64 %.02.i, %reass.sub.i, !dbg !16 + br i1 %exitcond.not.i, label %__barray_check_none_borrowed.exit, label %mask_block_ok.i, !dbg !16 + +mask_block_ok.i: ; preds = %alloca_block, %19 + %.02.i = phi i64 [ %20, %19 ], [ 0, %alloca_block ], !dbg !18 + %gep.i = getelementptr i64, ptr %7, i64 %.02.i, !dbg !16 + %21 = load i64, ptr %gep.i, align 4, !dbg !16 + %22 = icmp eq i64 %21, 0, !dbg !16 + br i1 %22, label %19, label %mask_block_err.i, !dbg !16 + +mask_block_err.i: ; preds = %mask_block_ok.i + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !16 + unreachable, !dbg !16 + +__barray_check_none_borrowed.exit: ; preds = %19, %alloca_block + %23 = tail call ptr @heap_alloc(i64 8), !dbg !18 + %24 = tail call ptr @heap_alloc(i64 8), !dbg !18 + store i64 0, ptr %24, align 1, !dbg !18 + %25 = getelementptr inbounds i1, ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %26 = load i64, ptr %25, align 1, !dbg !18 + store i64 %26, ptr %23, align 1, !dbg !18 + %27 = load i64, ptr %7, align 4, !dbg !19 + %28 = and i64 %27, %10, !dbg !19 + store i64 %28, ptr %7, align 4, !dbg !19 + %29 = load i64, ptr %13, align 4, !dbg !19 + %30 = and i64 %29, %17, !dbg !19 + store i64 %30, ptr %13, align 4, !dbg !19 + br i1 %.not.i, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +31: ; preds = %mask_block_ok.i183 + %32 = add nuw i64 %.02.i184, 1, !dbg !19 + %exitcond.not.i187 = icmp eq i64 %.02.i184, %reass.sub.i, !dbg !19 + br i1 %exitcond.not.i187, label %__barray_check_none_borrowed.exit188, label %mask_block_ok.i183, !dbg !19 + +mask_block_ok.i183: ; preds = %__barray_check_none_borrowed.exit, %31 + %.02.i184 = phi i64 [ %32, %31 ], [ 0, %__barray_check_none_borrowed.exit ], !dbg !18 + %gep.i185 = getelementptr i64, ptr %7, i64 %.02.i184, !dbg !19 + %33 = load i64, ptr %gep.i185, align 4, !dbg !19 + %34 = icmp eq i64 %33, 0, !dbg !19 + br i1 %34, label %31, label %mask_block_err.i186, !dbg !19 + +mask_block_err.i186: ; preds = %mask_block_ok.i183 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !19 + unreachable, !dbg !19 + +__barray_check_none_borrowed.exit188: ; preds = %31, %__barray_check_none_borrowed.exit + %35 = lshr i64 %.fca.2.extract159, 6, !dbg !21 + %36 = getelementptr i64, ptr %.fca.1.extract157, i64 %35, !dbg !21 + %37 = load i64, ptr %36, align 4, !dbg !21 + %38 = and i64 %.fca.2.extract159, 63, !dbg !21 + %39 = shl nsw i64 -1, %38, !dbg !21 + %40 = and i64 %37, %39, !dbg !21 + store i64 %40, ptr %36, align 4, !dbg !21 + %last_valid.i189 = add i64 %.fca.2.extract159, 2, !dbg !21 + %41 = lshr i64 %last_valid.i189, 6, !dbg !21 + %42 = getelementptr inbounds nuw i64, ptr %.fca.1.extract157, i64 %41, !dbg !21 + %43 = load i64, ptr %42, align 4, !dbg !21 + %44 = and i64 %last_valid.i189, 63, !dbg !21 + %45 = xor i64 %44, 63, !dbg !21 + %46 = lshr i64 -1, %45, !dbg !21 + %47 = and i64 %43, %46, !dbg !21 + store i64 %47, ptr %42, align 4, !dbg !21 + %reass.sub.i190 = sub nsw i64 %41, %35, !dbg !21 + %.not.i191 = icmp eq i64 %reass.sub.i190, -1, !dbg !21 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +48: ; preds = %mask_block_ok.i192 + %49 = add nuw i64 %.02.i193, 1, !dbg !21 + %exitcond.not.i196 = icmp eq i64 %.02.i193, %reass.sub.i190, !dbg !21 + br i1 %exitcond.not.i196, label %__barray_check_none_borrowed.exit197, label %mask_block_ok.i192, !dbg !21 + +mask_block_ok.i192: ; preds = %__barray_check_none_borrowed.exit188, %48 + %.02.i193 = phi i64 [ %49, %48 ], [ 0, %__barray_check_none_borrowed.exit188 ], !dbg !23 + %gep.i194 = getelementptr i64, ptr %36, i64 %.02.i193, !dbg !21 + %50 = load i64, ptr %gep.i194, align 4, !dbg !21 + %51 = icmp eq i64 %50, 0, !dbg !21 + br i1 %51, label %48, label %mask_block_err.i195, !dbg !21 + +mask_block_err.i195: ; preds = %mask_block_ok.i192 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !21 + unreachable, !dbg !21 + +__barray_check_none_borrowed.exit197: ; preds = %48, %__barray_check_none_borrowed.exit188 + %52 = tail call ptr @heap_alloc(i64 24), !dbg !23 + %53 = tail call ptr @heap_alloc(i64 8), !dbg !23 + store i64 0, ptr %53, align 1, !dbg !23 + %54 = getelementptr inbounds double, ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(24) %52, ptr noundef nonnull align 1 dereferenceable(24) %54, i64 24, i1 false), !dbg !23 + %55 = load i64, ptr %36, align 4, !dbg !24 + %56 = and i64 %55, %39, !dbg !24 + store i64 %56, ptr %36, align 4, !dbg !24 + %57 = load i64, ptr %42, align 4, !dbg !24 + %58 = and i64 %57, %46, !dbg !24 + store i64 %58, ptr %42, align 4, !dbg !24 + br i1 %.not.i191, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +59: ; preds = %mask_block_ok.i201 + %60 = add nuw i64 %.02.i202, 1, !dbg !24 + %exitcond.not.i205 = icmp eq i64 %.02.i202, %reass.sub.i190, !dbg !24 + br i1 %exitcond.not.i205, label %__barray_check_none_borrowed.exit206, label %mask_block_ok.i201, !dbg !24 + +mask_block_ok.i201: ; preds = %__barray_check_none_borrowed.exit197, %59 + %.02.i202 = phi i64 [ %60, %59 ], [ 0, %__barray_check_none_borrowed.exit197 ], !dbg !23 + %gep.i203 = getelementptr i64, ptr %36, i64 %.02.i202, !dbg !24 + %61 = load i64, ptr %gep.i203, align 4, !dbg !24 + %62 = icmp eq i64 %61, 0, !dbg !24 + br i1 %62, label %59, label %mask_block_err.i204, !dbg !24 + +mask_block_err.i204: ; preds = %mask_block_ok.i201 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !24 + unreachable, !dbg !24 + +__barray_check_none_borrowed.exit206: ; preds = %59, %__barray_check_none_borrowed.exit197 + %63 = lshr i64 %.fca.2.extract165, 6, !dbg !26 + %64 = getelementptr i64, ptr %.fca.1.extract163, i64 %63, !dbg !26 + %65 = load i64, ptr %64, align 4, !dbg !26 + %66 = and i64 %.fca.2.extract165, 63, !dbg !26 + %67 = shl nsw i64 -1, %66, !dbg !26 + %68 = and i64 %65, %67, !dbg !26 + store i64 %68, ptr %64, align 4, !dbg !26 + %last_valid.i207 = add i64 %.fca.2.extract165, 4, !dbg !26 + %69 = lshr i64 %last_valid.i207, 6, !dbg !26 + %70 = getelementptr inbounds nuw i64, ptr %.fca.1.extract163, i64 %69, !dbg !26 + %71 = load i64, ptr %70, align 4, !dbg !26 + %72 = and i64 %last_valid.i207, 63, !dbg !26 + %73 = xor i64 %72, 63, !dbg !26 + %74 = lshr i64 -1, %73, !dbg !26 + %75 = and i64 %71, %74, !dbg !26 + store i64 %75, ptr %70, align 4, !dbg !26 + %reass.sub.i208 = sub nsw i64 %69, %63, !dbg !26 + %.not.i209 = icmp eq i64 %reass.sub.i208, -1, !dbg !26 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +76: ; preds = %mask_block_ok.i210 + %77 = add nuw i64 %.02.i211, 1, !dbg !26 + %exitcond.not.i214 = icmp eq i64 %.02.i211, %reass.sub.i208, !dbg !26 + br i1 %exitcond.not.i214, label %__barray_check_none_borrowed.exit215, label %mask_block_ok.i210, !dbg !26 + +mask_block_ok.i210: ; preds = %__barray_check_none_borrowed.exit206, %76 + %.02.i211 = phi i64 [ %77, %76 ], [ 0, %__barray_check_none_borrowed.exit206 ], !dbg !28 + %gep.i212 = getelementptr i64, ptr %64, i64 %.02.i211, !dbg !26 + %78 = load i64, ptr %gep.i212, align 4, !dbg !26 + %79 = icmp eq i64 %78, 0, !dbg !26 + br i1 %79, label %76, label %mask_block_err.i213, !dbg !26 + +mask_block_err.i213: ; preds = %mask_block_ok.i210 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !26 + unreachable, !dbg !26 + +__barray_check_none_borrowed.exit215: ; preds = %76, %__barray_check_none_borrowed.exit206 + %80 = tail call ptr @heap_alloc(i64 40), !dbg !28 + %81 = tail call ptr @heap_alloc(i64 8), !dbg !28 + store i64 0, ptr %81, align 1, !dbg !28 + %82 = getelementptr inbounds i64, ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(40) %80, ptr noundef nonnull align 1 dereferenceable(40) %82, i64 40, i1 false), !dbg !28 + %83 = load i64, ptr %64, align 4, !dbg !29 + %84 = and i64 %83, %67, !dbg !29 + store i64 %84, ptr %64, align 4, !dbg !29 + %85 = load i64, ptr %70, align 4, !dbg !29 + %86 = and i64 %85, %74, !dbg !29 + store i64 %86, ptr %70, align 4, !dbg !29 + br i1 %.not.i209, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +87: ; preds = %mask_block_ok.i219 + %88 = add nuw i64 %.02.i220, 1, !dbg !29 + %exitcond.not.i223 = icmp eq i64 %.02.i220, %reass.sub.i208, !dbg !29 + br i1 %exitcond.not.i223, label %__barray_check_none_borrowed.exit224, label %mask_block_ok.i219, !dbg !29 + +mask_block_ok.i219: ; preds = %__barray_check_none_borrowed.exit215, %87 + %.02.i220 = phi i64 [ %88, %87 ], [ 0, %__barray_check_none_borrowed.exit215 ], !dbg !28 + %gep.i221 = getelementptr i64, ptr %64, i64 %.02.i220, !dbg !29 + %89 = load i64, ptr %gep.i221, align 4, !dbg !29 + %90 = icmp eq i64 %89, 0, !dbg !29 + br i1 %90, label %87, label %mask_block_err.i222, !dbg !29 + +mask_block_err.i222: ; preds = %mask_block_ok.i219 + tail call void @panic(i32 1002, ptr nonnull @"e_Some array.A77EF32E.0"), !dbg !29 + unreachable, !dbg !29 + +__barray_check_none_borrowed.exit224: ; preds = %87, %__barray_check_none_borrowed.exit215 + %91 = insertvalue { ptr, ptr, i64 } poison, ptr %80, 0, !dbg !28 + %92 = insertvalue { ptr, ptr, i64 } %91, ptr %81, 1, !dbg !28 + %93 = insertvalue { ptr, ptr, i64 } %92, i64 0, 2, !dbg !28 + %94 = insertvalue { ptr, ptr, i64 } poison, ptr %52, 0, !dbg !23 + %95 = insertvalue { ptr, ptr, i64 } %94, ptr %53, 1, !dbg !23 + %96 = insertvalue { ptr, ptr, i64 } %95, i64 0, 2, !dbg !23 + %97 = insertvalue { ptr, ptr, i64 } poison, ptr %23, 0, !dbg !18 + %98 = insertvalue { ptr, ptr, i64 } %97, ptr %24, 1, !dbg !18 + %99 = insertvalue { ptr, ptr, i64 } %98, i64 0, 2, !dbg !18 + tail call void @print_int(ptr nonnull @res_a.19FB4E83.0, i64 10, i64 %0), !dbg !31 + tail call void @print_float(ptr nonnull @res_b.0E048F9C.0, i64 12, double %1), !dbg !32 + tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 %2), !dbg !33 + %100 = getelementptr inbounds [5 x i64], ptr %.fca.0.extract161, i64 %.fca.2.extract165, !dbg !28 + %out_arr_alloca = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !28 + %y_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 4, !dbg !28 + %arr_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 8, !dbg !28 + %mask_ptr = getelementptr inbounds nuw i8, ptr %out_arr_alloca, i64 16, !dbg !28 + %101 = alloca [5 x i1], align 1, !dbg !28 + call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %101, i8 0, i64 5, i1 false), !dbg !28 + store i32 5, ptr %out_arr_alloca, align 8, !dbg !28 + store i32 1, ptr %y_ptr, align 4, !dbg !28 + store ptr %100, ptr %arr_ptr, align 8, !dbg !28 + store ptr %101, ptr %mask_ptr, align 8, !dbg !28 + call void @print_int_arr(ptr nonnull @res_d.93EDD03A.0, i64 13, ptr nonnull %out_arr_alloca), !dbg !28 + %102 = getelementptr inbounds [3 x double], ptr %.fca.0.extract155, i64 %.fca.2.extract159, !dbg !23 + %out_arr_alloca57 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !23 + %y_ptr59 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 4, !dbg !23 + %arr_ptr60 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 8, !dbg !23 + %mask_ptr61 = getelementptr inbounds nuw i8, ptr %out_arr_alloca57, i64 16, !dbg !23 + %103 = alloca [3 x i1], align 1, !dbg !23 + store i1 false, ptr %103, align 1, !dbg !23 + %.repack171 = getelementptr inbounds nuw i8, ptr %103, i64 1, !dbg !23 + store i1 false, ptr %.repack171, align 1, !dbg !23 + %.repack172 = getelementptr inbounds nuw i8, ptr %103, i64 2, !dbg !23 + store i1 false, ptr %.repack172, align 1, !dbg !23 + store i32 3, ptr %out_arr_alloca57, align 8, !dbg !23 + store i32 1, ptr %y_ptr59, align 4, !dbg !23 + store ptr %102, ptr %arr_ptr60, align 8, !dbg !23 + store ptr %103, ptr %mask_ptr61, align 8, !dbg !23 + call void @print_float_arr(ptr nonnull @res_e.DB2DB1D9.0, i64 15, ptr nonnull %out_arr_alloca57), !dbg !23 + %104 = getelementptr inbounds [8 x i1], ptr %.fca.0.extract149, i64 %.fca.2.extract153, !dbg !18 + %out_arr_alloca67 = alloca <{ i32, i32, ptr, ptr }>, align 8, !dbg !18 + %y_ptr69 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 4, !dbg !18 + %arr_ptr70 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 8, !dbg !18 + %mask_ptr71 = getelementptr inbounds nuw i8, ptr %out_arr_alloca67, i64 16, !dbg !18 + %105 = alloca [8 x i1], align 8, !dbg !18 + store i64 0, ptr %105, align 8, !dbg !18 + store i32 8, ptr %out_arr_alloca67, align 8, !dbg !18 + store i32 1, ptr %y_ptr69, align 4, !dbg !18 + store ptr %104, ptr %arr_ptr70, align 8, !dbg !18 + store ptr %105, ptr %mask_ptr71, align 8, !dbg !18 + call void @print_bool_arr(ptr nonnull @res_f.173699F1.0, i64 14, ptr nonnull %out_arr_alloca67), !dbg !18 + %mrv = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } poison, { ptr, ptr, i64 } %93, 0 + %mrv89 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv, { ptr, ptr, i64 } %96, 1 + %mrv90 = insertvalue { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv89, { ptr, ptr, i64 } %99, 2 + ret { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } %mrv90 +} + +; Function Attrs: noreturn +declare void @panic(i32, ptr) local_unnamed_addr #0 + +declare ptr @heap_alloc(i64) local_unnamed_addr + +; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #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 @print_int(ptr, i64, i64) local_unnamed_addr + +declare void @print_float(ptr, i64, double) local_unnamed_addr + +declare void @print_bool(ptr, i64, i1) 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 @print_bool_arr(ptr, i64, ptr) local_unnamed_addr + +declare void @argreader_get_bool_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_f64_array(ptr, ptr, i64) local_unnamed_addr + +declare void @argreader_get_i64_array(ptr, ptr, i64) local_unnamed_addr + +declare i1 @argreader_get_bool(ptr) local_unnamed_addr + +declare double @argreader_get_f64(ptr) local_unnamed_addr + +declare i64 @argreader_get_i64(ptr) local_unnamed_addr + +define i64 @qmain(i64 %0) local_unnamed_addr !dbg !34 { +entry: + tail call void @setup(i64 %0), !dbg !38 + %1 = tail call ptr @heap_alloc(i64 8), !dbg !38 + %2 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %2, align 1, !dbg !38 + %3 = insertvalue { ptr, ptr, i64 } poison, ptr %1, 0, !dbg !38 + %4 = insertvalue { ptr, ptr, i64 } %3, ptr %2, 1, !dbg !38 + %5 = insertvalue { ptr, ptr, i64 } %4, i64 0, 2, !dbg !38 + tail call void @argreader_get_bool_array(ptr nonnull @argument_arg_5.E3E8C60E.0, ptr %1, i64 8), !dbg !38 + %6 = tail call ptr @heap_alloc(i64 24), !dbg !38 + %7 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %7, align 1, !dbg !38 + %8 = insertvalue { ptr, ptr, i64 } poison, ptr %6, 0, !dbg !38 + %9 = insertvalue { ptr, ptr, i64 } %8, ptr %7, 1, !dbg !38 + %10 = insertvalue { ptr, ptr, i64 } %9, i64 0, 2, !dbg !38 + tail call void @argreader_get_f64_array(ptr nonnull @argument_arg_4.43DB6CC9.0, ptr %6, i64 3), !dbg !38 + %11 = tail call ptr @heap_alloc(i64 40), !dbg !38 + %12 = tail call ptr @heap_alloc(i64 8), !dbg !38 + store i64 0, ptr %12, align 1, !dbg !38 + %13 = insertvalue { ptr, ptr, i64 } poison, ptr %11, 0, !dbg !38 + %14 = insertvalue { ptr, ptr, i64 } %13, ptr %12, 1, !dbg !38 + %15 = insertvalue { ptr, ptr, i64 } %14, i64 0, 2, !dbg !38 + tail call void @argreader_get_i64_array(ptr nonnull @argument_arg_3.E6500947.0, ptr %11, i64 5), !dbg !38 + %read_arg_bool.i = tail call i1 @argreader_get_bool(ptr nonnull @argument_arg_2.32BF8FD7.0), !dbg !38 + %read_arg_f64.i = tail call double @argreader_get_f64(ptr nonnull @argument_arg_1.12764F87.0), !dbg !38 + %read_arg_int.i = tail call i64 @argreader_get_i64(ptr nonnull @argument_arg_0.0A040DE9.0), !dbg !38 + %16 = tail call { { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } } @"__hugr__.__main__.entry_args..foo.1"(i64 %read_arg_int.i, double %read_arg_f64.i, i1 %read_arg_bool.i, { ptr, ptr, i64 } %15, { ptr, ptr, i64 } %10, { ptr, ptr, i64 } %5), !dbg !38 + %17 = tail call i64 @teardown(), !dbg !38 + ret i64 %17, !dbg !38 +} + +declare void @setup(i64) local_unnamed_addr + +declare i64 @teardown() local_unnamed_addr + +attributes #0 = { noreturn } +attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } + +!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.0-a3)-v1.0.0-a3", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!3 = !{!"mainlib"} +!4 = distinct !DISubprogram(name: "entry_args..foo", linkageName: "__hugr__.__main__.entry_args..foo.1", scope: null, file: !5, line: 247, type: !6, scopeLine: 248, spFlags: DISPFlagDefinition, unit: !1) +!5 = !DIFile(filename: "/stripped/for/reproducibility", directory: "/stripped/for/reproducibility") +!6 = !DISubroutineType(types: !7) +!7 = !{!8, !13, !14, !15, !10, !10, !10} +!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ { ptr, ptr, i64 }, { ptr, ptr, i64 }, { ptr, ptr, i64 } }", file: !2, size: 576, align: 8, elements: !9) +!9 = !{!10, !10, !10} +!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !11) +!11 = !{!12, !12, !13} +!12 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) +!13 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!14 = !DIBasicType(name: "f64", size: 64, encoding: DW_ATE_float) +!15 = !DIBasicType(name: "i1", size: 1, encoding: DW_ATE_unsigned) +!16 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !17) +!17 = distinct !DILocation(line: 253, column: 8, scope: !4) +!18 = !DILocation(line: 253, column: 8, scope: !4) +!19 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !20) +!20 = distinct !DILocation(line: 253, column: 8, scope: !4) +!21 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !22) +!22 = distinct !DILocation(line: 252, column: 8, scope: !4) +!23 = !DILocation(line: 252, column: 8, scope: !4) +!24 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !25) +!25 = distinct !DILocation(line: 252, column: 8, scope: !4) +!26 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !27) +!27 = distinct !DILocation(line: 251, column: 8, scope: !4) +!28 = !DILocation(line: 251, column: 8, scope: !4) +!29 = !DILocation(line: 253, column: 8, scope: !4, inlinedAt: !30) +!30 = distinct !DILocation(line: 251, column: 8, scope: !4) +!31 = !DILocation(line: 248, column: 8, scope: !4) +!32 = !DILocation(line: 249, column: 8, scope: !4) +!33 = !DILocation(line: 250, column: 8, scope: !4) +!34 = distinct !DISubprogram(name: "qmain", linkageName: "qmain", scope: null, file: !35, type: !36, spFlags: DISPFlagDefinition, unit: !1) +!35 = !DIFile(filename: "COMPILER_GENERATED_CODE", directory: "") +!36 = !DISubroutineType(types: !37) +!37 = !{!13, !13} +!38 = !DILocation(line: 0, scope: !34) \ No newline at end of file diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol index caeeeb659..26c207afa 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.36.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37, !dbg !10 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41, !dbg !11 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45, !dbg !13 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol index 6db48e2c9..6cce3a02c 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol @@ -15,9 +15,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i - %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6, !dbg !72 - %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136, !dbg !72 +cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i + %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6, !dbg !72 + %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136, !dbg !72 %138 = load i64, ptr %137, align 4, !dbg !72 - %139 = and i64 %"421_1.sroa.10.0.i.i", 63, !dbg !72 + %139 = and i64 %"425_1.sroa.10.0.i.i", 63, !dbg !72 %140 = sub nuw nsw i64 64, %139, !dbg !72 %141 = lshr i64 -1, %140, !dbg !72 %142 = icmp eq i64 %139, 0, !dbg !72 %143 = select i1 %142, i64 0, i64 %141, !dbg !72 %144 = or i64 %138, %143, !dbg !72 store i64 %144, ptr %137, align 4, !dbg !72 - %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9, !dbg !72 + %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9, !dbg !72 %145 = lshr i64 %last_valid.i.i.i179, 6, !dbg !72 - %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145, !dbg !72 + %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145, !dbg !72 %147 = load i64, ptr %146, align 4, !dbg !72 %148 = and i64 %last_valid.i.i.i179, 63, !dbg !72 %149 = shl nsw i64 -2, %148, !dbg !72 @@ -474,8 +474,8 @@ cond_424_case_0.i.i: ; preds = %cond_exit_424.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180, !dbg !72 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182, !dbg !72 -mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183, !dbg !72 %155 = load i64, ptr %gep.i.i.i184, align 4, !dbg !72 %156 = icmp eq i64 %155, -1, !dbg !72 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0"), !dbg !72 unreachable, !dbg !72 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i - %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] - %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 - %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i + %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] + %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 + %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %165, %161, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol index 19430a132..ebd870e87 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit, !dbg !8 -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.19.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol index 37186b72b..fb57221c5 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit, !dbg !8 -cond_44_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"), !dbg !8 unreachable, !dbg !8 -__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol index 844943faf..0dd9d4eb9 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit, !dbg !8 -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.38.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.42.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol index 66030e5fd..f20a6c06e 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 + %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol index c51ef830b..742cd3358 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit, !dbg !8 -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] +__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i, !dbg !15 -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_helios index c64047453..f473a8cef 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_helios @@ -14,157 +14,157 @@ alloca_block: 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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.221.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.225.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.9, %__hugr__.__tk2_helios_qalloc.221.exit.8, %__hugr__.__tk2_helios_qalloc.221.exit.7, %__hugr__.__tk2_helios_qalloc.221.exit.6, %__hugr__.__tk2_helios_qalloc.221.exit.5, %__hugr__.__tk2_helios_qalloc.221.exit.4, %__hugr__.__tk2_helios_qalloc.221.exit.3, %__hugr__.__tk2_helios_qalloc.221.exit.2, %__hugr__.__tk2_helios_qalloc.221.exit.1, %__hugr__.__tk2_helios_qalloc.221.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.225.exit.8, %__hugr__.__tk2_helios_qalloc.225.exit.7, %__hugr__.__tk2_helios_qalloc.225.exit.6, %__hugr__.__tk2_helios_qalloc.225.exit.5, %__hugr__.__tk2_helios_qalloc.225.exit.4, %__hugr__.__tk2_helios_qalloc.225.exit.3, %__hugr__.__tk2_helios_qalloc.225.exit.2, %__hugr__.__tk2_helios_qalloc.225.exit.1, %__hugr__.__tk2_helios_qalloc.225.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit +cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.1 + br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.1 -__hugr__.__tk2_helios_qalloc.221.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.225.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.221.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.2 + br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.2 -__hugr__.__tk2_helios_qalloc.221.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.225.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 %.not117 = icmp eq i64 %10, 0 br i1 %.not117, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.3 + br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.3 -__hugr__.__tk2_helios_qalloc.221.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_helios_qalloc.225.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 %.not118 = icmp eq i64 %14, 0 br i1 %.not118, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.4 + br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.4 -__hugr__.__tk2_helios_qalloc.221.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_helios_qalloc.225.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 %.not119 = icmp eq i64 %18, 0 br i1 %.not119, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.5 + br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.5 -__hugr__.__tk2_helios_qalloc.221.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_helios_qalloc.225.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 %.not120 = icmp eq i64 %22, 0 br i1 %.not120, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.6 + br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.6 -__hugr__.__tk2_helios_qalloc.221.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_helios_qalloc.225.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 %.not121 = icmp eq i64 %26, 0 br i1 %.not121, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.7 + br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.7 -__hugr__.__tk2_helios_qalloc.221.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_helios_qalloc.225.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 %.not122 = icmp eq i64 %30, 0 br i1 %.not122, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.8 + br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.8 -__hugr__.__tk2_helios_qalloc.221.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_helios_qalloc.225.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 %.not123 = icmp eq i64 %34, 0 br i1 %.not123, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_229_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_helios index 2d9277dc2..ad2d7cbab 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.40.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_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34) %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_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios index d97baac8e..2fe74384f 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios @@ -15,157 +15,157 @@ alloca_block: 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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.374.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.378.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.9, %__hugr__.__tk2_helios_qalloc.374.exit.8, %__hugr__.__tk2_helios_qalloc.374.exit.7, %__hugr__.__tk2_helios_qalloc.374.exit.6, %__hugr__.__tk2_helios_qalloc.374.exit.5, %__hugr__.__tk2_helios_qalloc.374.exit.4, %__hugr__.__tk2_helios_qalloc.374.exit.3, %__hugr__.__tk2_helios_qalloc.374.exit.2, %__hugr__.__tk2_helios_qalloc.374.exit.1, %__hugr__.__tk2_helios_qalloc.374.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.378.exit.8, %__hugr__.__tk2_helios_qalloc.378.exit.7, %__hugr__.__tk2_helios_qalloc.378.exit.6, %__hugr__.__tk2_helios_qalloc.378.exit.5, %__hugr__.__tk2_helios_qalloc.378.exit.4, %__hugr__.__tk2_helios_qalloc.378.exit.3, %__hugr__.__tk2_helios_qalloc.378.exit.2, %__hugr__.__tk2_helios_qalloc.378.exit.1, %__hugr__.__tk2_helios_qalloc.378.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit +cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.1 + br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.1 -__hugr__.__tk2_helios_qalloc.374.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.378.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 %.not199 = icmp eq i64 %6, 0 br i1 %.not199, label %panic.i, label %cond_exit_20.1 -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.2 + br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.2 -__hugr__.__tk2_helios_qalloc.374.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.378.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 %.not200 = icmp eq i64 %10, 0 br i1 %.not200, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.3 + br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.3 -__hugr__.__tk2_helios_qalloc.374.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_helios_qalloc.378.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 %.not201 = icmp eq i64 %14, 0 br i1 %.not201, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.4 + br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.4 -__hugr__.__tk2_helios_qalloc.374.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_helios_qalloc.378.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 %.not202 = icmp eq i64 %18, 0 br i1 %.not202, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.5 + br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.5 -__hugr__.__tk2_helios_qalloc.374.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_helios_qalloc.378.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 %.not203 = icmp eq i64 %22, 0 br i1 %.not203, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.6 + br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.6 -__hugr__.__tk2_helios_qalloc.374.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_helios_qalloc.378.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 %.not204 = icmp eq i64 %26, 0 br i1 %.not204, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.7 + br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.7 -__hugr__.__tk2_helios_qalloc.374.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_helios_qalloc.378.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 %.not205 = icmp eq i64 %30, 0 br i1 %.not205, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.8 + br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.8 -__hugr__.__tk2_helios_qalloc.374.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_helios_qalloc.378.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 %.not206 = icmp eq i64 %34, 0 br i1 %.not206, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_405_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) @@ -399,16 +399,16 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 - %117 = lshr i64 %"421_1.sroa.10.0.i.i", 6 - %118 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %117 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 + %117 = lshr i64 %"425_1.sroa.10.0.i.i", 6 + %118 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %117 %119 = load i64, ptr %118, align 4 - %120 = and i64 %"421_1.sroa.10.0.i.i", 63 + %120 = and i64 %"425_1.sroa.10.0.i.i", 63 %121 = lshr i64 %119, %120 %122 = trunc i64 %121 to i1 - br i1 %122, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %122, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" %123 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" ], [ %265, %loop_body.i177 ] @@ -452,8 +452,8 @@ panic.i222.i.i: ; preds = %__barray_check_boun %exitcond.not.i.i.i185 = icmp eq i64 %.02.i.i.i182, %reass.sub.i.i.i179 br i1 %exitcond.not.i.i.i185, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i181 -mask_block_ok.i.i.i181: ; preds = %cond_exit_424.thread.9.i.i, %139 - %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_424.thread.9.i.i ] +mask_block_ok.i.i.i181: ; preds = %cond_exit_428.thread.9.i.i, %139 + %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_428.thread.9.i.i ] %gep.i.i.i183 = getelementptr i64, ptr %118, i64 %.02.i.i.i182 %141 = load i64, ptr %gep.i.i.i183, align 4 %142 = icmp eq i64 %141, -1 @@ -467,183 +467,183 @@ __barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader %143 = shl nuw i64 1, %120 %144 = xor i64 %119, %143 store i64 %144, ptr %118, align 4 - %145 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %"421_1.sroa.10.0.i.i" + %145 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %"425_1.sroa.10.0.i.i" %146 = load i64, ptr %145, align 4 tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %147 = add i64 %"421_1.sroa.10.0.i.i", 1 +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i + %147 = add i64 %"425_1.sroa.10.0.i.i", 1 %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %148 + %149 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i + br i1 %153, label %cond_exit_428.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_424.thread.i.i +__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_428.thread.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 %"421_1.sroa.0.0.i.i", i64 %147 + %156 = getelementptr inbounds i64, ptr %"425_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_424.thread.1.i.i + br label %cond_exit_428.thread.1.i.i -cond_exit_424.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_424.thread.i.i - %158 = add i64 %"421_1.sroa.10.0.i.i", 2 +cond_exit_428.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_428.thread.i.i + %158 = add i64 %"425_1.sroa.10.0.i.i", 2 %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i + br i1 %164, label %cond_exit_428.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_424.thread.1.i.i +__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_428.thread.1.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 %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.2.i.i + br label %cond_exit_428.thread.2.i.i -cond_exit_424.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_424.thread.1.i.i - %169 = add i64 %"421_1.sroa.10.0.i.i", 3 +cond_exit_428.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_428.thread.1.i.i + %169 = add i64 %"425_1.sroa.10.0.i.i", 3 %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %170 + %171 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i + br i1 %175, label %cond_exit_428.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_424.thread.2.i.i +__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_428.thread.2.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 %"421_1.sroa.0.0.i.i", i64 %169 + %178 = getelementptr inbounds i64, ptr %"425_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_424.thread.3.i.i + br label %cond_exit_428.thread.3.i.i -cond_exit_424.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_424.thread.2.i.i - %180 = add i64 %"421_1.sroa.10.0.i.i", 4 +cond_exit_428.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_428.thread.2.i.i + %180 = add i64 %"425_1.sroa.10.0.i.i", 4 %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %181 + %182 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i + br i1 %186, label %cond_exit_428.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_424.thread.3.i.i +__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_428.thread.3.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 %"421_1.sroa.0.0.i.i", i64 %180 + %189 = getelementptr inbounds i64, ptr %"425_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_424.thread.4.i.i + br label %cond_exit_428.thread.4.i.i -cond_exit_424.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_424.thread.3.i.i - %191 = add i64 %"421_1.sroa.10.0.i.i", 5 +cond_exit_428.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_428.thread.3.i.i + %191 = add i64 %"425_1.sroa.10.0.i.i", 5 %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %192 + %193 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i + br i1 %197, label %cond_exit_428.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_424.thread.4.i.i +__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_428.thread.4.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 %"421_1.sroa.0.0.i.i", i64 %191 + %200 = getelementptr inbounds i64, ptr %"425_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_424.thread.5.i.i + br label %cond_exit_428.thread.5.i.i -cond_exit_424.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_424.thread.4.i.i - %202 = add i64 %"421_1.sroa.10.0.i.i", 6 +cond_exit_428.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_428.thread.4.i.i + %202 = add i64 %"425_1.sroa.10.0.i.i", 6 %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %203 + %204 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i + br i1 %208, label %cond_exit_428.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_424.thread.5.i.i +__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_428.thread.5.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 %"421_1.sroa.0.0.i.i", i64 %202 + %211 = getelementptr inbounds i64, ptr %"425_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_424.thread.6.i.i + br label %cond_exit_428.thread.6.i.i -cond_exit_424.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_424.thread.5.i.i - %213 = add i64 %"421_1.sroa.10.0.i.i", 7 +cond_exit_428.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_428.thread.5.i.i + %213 = add i64 %"425_1.sroa.10.0.i.i", 7 %214 = lshr i64 %213, 6 - %215 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %214 + %215 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %214 %216 = load i64, ptr %215, align 4 %217 = and i64 %213, 63 %218 = lshr i64 %216, %217 %219 = trunc i64 %218 to i1 - br i1 %219, label %cond_exit_424.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i + br i1 %219, label %cond_exit_428.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_424.thread.6.i.i +__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_428.thread.6.i.i %220 = shl nuw i64 1, %217 %221 = xor i64 %216, %220 store i64 %221, ptr %215, align 4 - %222 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %213 + %222 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %213 %223 = load i64, ptr %222, align 4 tail call void @___dec_future_refcount(i64 %223) - br label %cond_exit_424.thread.7.i.i + br label %cond_exit_428.thread.7.i.i -cond_exit_424.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_424.thread.6.i.i - %224 = add i64 %"421_1.sroa.10.0.i.i", 8 +cond_exit_428.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_428.thread.6.i.i + %224 = add i64 %"425_1.sroa.10.0.i.i", 8 %225 = lshr i64 %224, 6 - %226 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %225 + %226 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %225 %227 = load i64, ptr %226, align 4 %228 = and i64 %224, 63 %229 = lshr i64 %227, %228 %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_424.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i + br i1 %230, label %cond_exit_428.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_424.thread.7.i.i +__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_428.thread.7.i.i %231 = shl nuw i64 1, %228 %232 = xor i64 %227, %231 store i64 %232, ptr %226, align 4 - %233 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %224 + %233 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %224 %234 = load i64, ptr %233, align 4 tail call void @___dec_future_refcount(i64 %234) - br label %cond_exit_424.thread.8.i.i + br label %cond_exit_428.thread.8.i.i -cond_exit_424.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_424.thread.7.i.i - %235 = add i64 %"421_1.sroa.10.0.i.i", 9 +cond_exit_428.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_428.thread.7.i.i + %235 = add i64 %"425_1.sroa.10.0.i.i", 9 %236 = lshr i64 %235, 6 - %237 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %236 + %237 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %236 %238 = load i64, ptr %237, align 4 %239 = and i64 %235, 63 %240 = lshr i64 %238, %239 %241 = trunc i64 %240 to i1 - br i1 %241, label %cond_exit_424.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i + br i1 %241, label %cond_exit_428.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_424.thread.8.i.i +__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_428.thread.8.i.i %242 = shl nuw i64 1, %239 %243 = xor i64 %238, %242 store i64 %243, ptr %237, align 4 - %244 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %235 + %244 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %235 %245 = load i64, ptr %244, align 4 tail call void @___dec_future_refcount(i64 %245) - br label %cond_exit_424.thread.9.i.i + br label %cond_exit_428.thread.9.i.i -cond_exit_424.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_424.thread.8.i.i +cond_exit_428.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_428.thread.8.i.i %246 = load i64, ptr %118, align 4 %247 = sub nuw nsw i64 64, %120 %248 = lshr i64 -1, %247 @@ -687,9 +687,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %124, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_424.thread.9.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_428.thread.9.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %115) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios index b23bf7a6a..8ea26533f 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.19.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios index 5f3d91892..76c013625 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = 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_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit -cond_44_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.44.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.44.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.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios index a95b80c78..6de097e5c 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = 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_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.42.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.42.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.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios index 4fed018b2..90be7a009 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) + %shot.i.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_helios index cc28debf2..5a715d81c 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_helios @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_600_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_604_case_0.i, label %__barray_check_bounds.exit -cond_600_case_0.i: ; preds = %cond_20_case_1 +cond_604_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"620_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"620_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"620_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"624_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"624_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"624_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_623_case_0.i.i: ; preds = %cond_exit_623.thread.i.i - %85 = lshr i64 %"620_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"620_1.sroa.5.0.i.i", i64 %85 +cond_627_case_0.i.i: ; preds = %cond_exit_627.thread.i.i + %85 = lshr i64 %"624_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"624_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"620_1.sroa.10.0.i.i", 63 + %88 = and i64 %"624_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"620_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"624_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_623_case_0.i.i: ; preds = %cond_exit_623.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_623_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_623_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_627_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_627_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_623.thread.i.i, %loop_body.preheader.i.i - %"620_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_623.thread.i.i ] - %106 = add nuw nsw i64 %"620_0.0239.i.i", 1 - %107 = add i64 %"620_0.0239.i.i", %"620_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_627.thread.i.i, %loop_body.preheader.i.i + %"624_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_627.thread.i.i ] + %106 = add nuw nsw i64 %"624_0.0239.i.i", 1 + %107 = add i64 %"624_0.0239.i.i", %"624_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_623.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_627.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"620_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"624_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_623.thread.i.i + br label %cond_exit_627.thread.i.i -cond_exit_623.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_627.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_623_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_627_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_623_case_0.i.i - tail call void @heap_free(ptr %"620_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"620_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_627_case_0.i.i + tail call void @heap_free(ptr %"624_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"624_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios index 83bdf320e..6dc3be766 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] +__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i -1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_helios index 83c604596..5113e18bf 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_helios @@ -14,157 +14,157 @@ alloca_block: 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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.221.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.225.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.9, %__hugr__.__tk2_helios_qalloc.221.exit.8, %__hugr__.__tk2_helios_qalloc.221.exit.7, %__hugr__.__tk2_helios_qalloc.221.exit.6, %__hugr__.__tk2_helios_qalloc.221.exit.5, %__hugr__.__tk2_helios_qalloc.221.exit.4, %__hugr__.__tk2_helios_qalloc.221.exit.3, %__hugr__.__tk2_helios_qalloc.221.exit.2, %__hugr__.__tk2_helios_qalloc.221.exit.1, %__hugr__.__tk2_helios_qalloc.221.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.225.exit.8, %__hugr__.__tk2_helios_qalloc.225.exit.7, %__hugr__.__tk2_helios_qalloc.225.exit.6, %__hugr__.__tk2_helios_qalloc.225.exit.5, %__hugr__.__tk2_helios_qalloc.225.exit.4, %__hugr__.__tk2_helios_qalloc.225.exit.3, %__hugr__.__tk2_helios_qalloc.225.exit.2, %__hugr__.__tk2_helios_qalloc.225.exit.1, %__hugr__.__tk2_helios_qalloc.225.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit +cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.1 + br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.1 -__hugr__.__tk2_helios_qalloc.221.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.225.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.221.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.2 + br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.2 -__hugr__.__tk2_helios_qalloc.221.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.225.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 %.not117 = icmp eq i64 %10, 0 br i1 %.not117, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.3 + br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.3 -__hugr__.__tk2_helios_qalloc.221.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_helios_qalloc.225.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 %.not118 = icmp eq i64 %14, 0 br i1 %.not118, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.4 + br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.4 -__hugr__.__tk2_helios_qalloc.221.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_helios_qalloc.225.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 %.not119 = icmp eq i64 %18, 0 br i1 %.not119, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.5 + br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.5 -__hugr__.__tk2_helios_qalloc.221.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_helios_qalloc.225.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 %.not120 = icmp eq i64 %22, 0 br i1 %.not120, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.6 + br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.6 -__hugr__.__tk2_helios_qalloc.221.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_helios_qalloc.225.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 %.not121 = icmp eq i64 %26, 0 br i1 %.not121, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.7 + br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.7 -__hugr__.__tk2_helios_qalloc.221.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_helios_qalloc.225.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 %.not122 = icmp eq i64 %30, 0 br i1 %.not122, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.8 + br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.8 -__hugr__.__tk2_helios_qalloc.221.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_helios_qalloc.225.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 %.not123 = icmp eq i64 %34, 0 br i1 %.not123, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.221.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.225.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_225_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_229_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_helios index 073e3cfac..e5ab1f660 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.40.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_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34) %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_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_helios index 3844172a3..6485ed74a 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_helios @@ -15,157 +15,157 @@ alloca_block: 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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.374.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.378.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.9, %__hugr__.__tk2_helios_qalloc.374.exit.8, %__hugr__.__tk2_helios_qalloc.374.exit.7, %__hugr__.__tk2_helios_qalloc.374.exit.6, %__hugr__.__tk2_helios_qalloc.374.exit.5, %__hugr__.__tk2_helios_qalloc.374.exit.4, %__hugr__.__tk2_helios_qalloc.374.exit.3, %__hugr__.__tk2_helios_qalloc.374.exit.2, %__hugr__.__tk2_helios_qalloc.374.exit.1, %__hugr__.__tk2_helios_qalloc.374.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.378.exit.8, %__hugr__.__tk2_helios_qalloc.378.exit.7, %__hugr__.__tk2_helios_qalloc.378.exit.6, %__hugr__.__tk2_helios_qalloc.378.exit.5, %__hugr__.__tk2_helios_qalloc.378.exit.4, %__hugr__.__tk2_helios_qalloc.378.exit.3, %__hugr__.__tk2_helios_qalloc.378.exit.2, %__hugr__.__tk2_helios_qalloc.378.exit.1, %__hugr__.__tk2_helios_qalloc.378.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit +cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.1 + br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.1 -__hugr__.__tk2_helios_qalloc.374.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.378.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 %.not199 = icmp eq i64 %6, 0 br i1 %.not199, label %panic.i, label %cond_exit_20.1 -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.2 + br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.2 -__hugr__.__tk2_helios_qalloc.374.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.378.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 %.not200 = icmp eq i64 %10, 0 br i1 %.not200, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.3 + br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.3 -__hugr__.__tk2_helios_qalloc.374.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_helios_qalloc.378.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 %.not201 = icmp eq i64 %14, 0 br i1 %.not201, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.4 + br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.4 -__hugr__.__tk2_helios_qalloc.374.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_helios_qalloc.378.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 %.not202 = icmp eq i64 %18, 0 br i1 %.not202, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.5 + br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.5 -__hugr__.__tk2_helios_qalloc.374.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_helios_qalloc.378.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 %.not203 = icmp eq i64 %22, 0 br i1 %.not203, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.6 + br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.6 -__hugr__.__tk2_helios_qalloc.374.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_helios_qalloc.378.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 %.not204 = icmp eq i64 %26, 0 br i1 %.not204, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.7 + br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.7 -__hugr__.__tk2_helios_qalloc.374.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_helios_qalloc.378.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 %.not205 = icmp eq i64 %30, 0 br i1 %.not205, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.8 + br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.8 -__hugr__.__tk2_helios_qalloc.374.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_helios_qalloc.378.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 %.not206 = icmp eq i64 %34, 0 br i1 %.not206, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.374.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.378.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_401_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_405_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) @@ -399,16 +399,16 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 - %117 = lshr i64 %"421_1.sroa.10.0.i.i", 6 - %118 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %117 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 + %117 = lshr i64 %"425_1.sroa.10.0.i.i", 6 + %118 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %117 %119 = load i64, ptr %118, align 4 - %120 = and i64 %"421_1.sroa.10.0.i.i", 63 + %120 = and i64 %"425_1.sroa.10.0.i.i", 63 %121 = lshr i64 %119, %120 %122 = trunc i64 %121 to i1 - br i1 %122, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %122, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" %123 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" ], [ %265, %loop_body.i177 ] @@ -452,8 +452,8 @@ panic.i222.i.i: ; preds = %__barray_check_boun %exitcond.not.i.i.i185 = icmp eq i64 %.02.i.i.i182, %reass.sub.i.i.i179 br i1 %exitcond.not.i.i.i185, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i181 -mask_block_ok.i.i.i181: ; preds = %cond_exit_424.thread.9.i.i, %139 - %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_424.thread.9.i.i ] +mask_block_ok.i.i.i181: ; preds = %cond_exit_428.thread.9.i.i, %139 + %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_428.thread.9.i.i ] %gep.i.i.i183 = getelementptr i64, ptr %118, i64 %.02.i.i.i182 %141 = load i64, ptr %gep.i.i.i183, align 4 %142 = icmp eq i64 %141, -1 @@ -467,183 +467,183 @@ __barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader %143 = shl nuw i64 1, %120 %144 = xor i64 %119, %143 store i64 %144, ptr %118, align 4 - %145 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %"421_1.sroa.10.0.i.i" + %145 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %"425_1.sroa.10.0.i.i" %146 = load i64, ptr %145, align 4 tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %147 = add i64 %"421_1.sroa.10.0.i.i", 1 +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i + %147 = add i64 %"425_1.sroa.10.0.i.i", 1 %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %148 + %149 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i + br i1 %153, label %cond_exit_428.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_424.thread.i.i +__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_428.thread.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 %"421_1.sroa.0.0.i.i", i64 %147 + %156 = getelementptr inbounds i64, ptr %"425_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_424.thread.1.i.i + br label %cond_exit_428.thread.1.i.i -cond_exit_424.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_424.thread.i.i - %158 = add i64 %"421_1.sroa.10.0.i.i", 2 +cond_exit_428.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_428.thread.i.i + %158 = add i64 %"425_1.sroa.10.0.i.i", 2 %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i + br i1 %164, label %cond_exit_428.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_424.thread.1.i.i +__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_428.thread.1.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 %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.2.i.i + br label %cond_exit_428.thread.2.i.i -cond_exit_424.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_424.thread.1.i.i - %169 = add i64 %"421_1.sroa.10.0.i.i", 3 +cond_exit_428.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_428.thread.1.i.i + %169 = add i64 %"425_1.sroa.10.0.i.i", 3 %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %170 + %171 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i + br i1 %175, label %cond_exit_428.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_424.thread.2.i.i +__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_428.thread.2.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 %"421_1.sroa.0.0.i.i", i64 %169 + %178 = getelementptr inbounds i64, ptr %"425_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_424.thread.3.i.i + br label %cond_exit_428.thread.3.i.i -cond_exit_424.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_424.thread.2.i.i - %180 = add i64 %"421_1.sroa.10.0.i.i", 4 +cond_exit_428.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_428.thread.2.i.i + %180 = add i64 %"425_1.sroa.10.0.i.i", 4 %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %181 + %182 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i + br i1 %186, label %cond_exit_428.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_424.thread.3.i.i +__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_428.thread.3.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 %"421_1.sroa.0.0.i.i", i64 %180 + %189 = getelementptr inbounds i64, ptr %"425_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_424.thread.4.i.i + br label %cond_exit_428.thread.4.i.i -cond_exit_424.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_424.thread.3.i.i - %191 = add i64 %"421_1.sroa.10.0.i.i", 5 +cond_exit_428.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_428.thread.3.i.i + %191 = add i64 %"425_1.sroa.10.0.i.i", 5 %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %192 + %193 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i + br i1 %197, label %cond_exit_428.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_424.thread.4.i.i +__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_428.thread.4.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 %"421_1.sroa.0.0.i.i", i64 %191 + %200 = getelementptr inbounds i64, ptr %"425_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_424.thread.5.i.i + br label %cond_exit_428.thread.5.i.i -cond_exit_424.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_424.thread.4.i.i - %202 = add i64 %"421_1.sroa.10.0.i.i", 6 +cond_exit_428.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_428.thread.4.i.i + %202 = add i64 %"425_1.sroa.10.0.i.i", 6 %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %203 + %204 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i + br i1 %208, label %cond_exit_428.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_424.thread.5.i.i +__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_428.thread.5.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 %"421_1.sroa.0.0.i.i", i64 %202 + %211 = getelementptr inbounds i64, ptr %"425_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_424.thread.6.i.i + br label %cond_exit_428.thread.6.i.i -cond_exit_424.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_424.thread.5.i.i - %213 = add i64 %"421_1.sroa.10.0.i.i", 7 +cond_exit_428.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_428.thread.5.i.i + %213 = add i64 %"425_1.sroa.10.0.i.i", 7 %214 = lshr i64 %213, 6 - %215 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %214 + %215 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %214 %216 = load i64, ptr %215, align 4 %217 = and i64 %213, 63 %218 = lshr i64 %216, %217 %219 = trunc i64 %218 to i1 - br i1 %219, label %cond_exit_424.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i + br i1 %219, label %cond_exit_428.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_424.thread.6.i.i +__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_428.thread.6.i.i %220 = shl nuw i64 1, %217 %221 = xor i64 %216, %220 store i64 %221, ptr %215, align 4 - %222 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %213 + %222 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %213 %223 = load i64, ptr %222, align 4 tail call void @___dec_future_refcount(i64 %223) - br label %cond_exit_424.thread.7.i.i + br label %cond_exit_428.thread.7.i.i -cond_exit_424.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_424.thread.6.i.i - %224 = add i64 %"421_1.sroa.10.0.i.i", 8 +cond_exit_428.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_428.thread.6.i.i + %224 = add i64 %"425_1.sroa.10.0.i.i", 8 %225 = lshr i64 %224, 6 - %226 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %225 + %226 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %225 %227 = load i64, ptr %226, align 4 %228 = and i64 %224, 63 %229 = lshr i64 %227, %228 %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_424.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i + br i1 %230, label %cond_exit_428.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_424.thread.7.i.i +__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_428.thread.7.i.i %231 = shl nuw i64 1, %228 %232 = xor i64 %227, %231 store i64 %232, ptr %226, align 4 - %233 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %224 + %233 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %224 %234 = load i64, ptr %233, align 4 tail call void @___dec_future_refcount(i64 %234) - br label %cond_exit_424.thread.8.i.i + br label %cond_exit_428.thread.8.i.i -cond_exit_424.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_424.thread.7.i.i - %235 = add i64 %"421_1.sroa.10.0.i.i", 9 +cond_exit_428.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_428.thread.7.i.i + %235 = add i64 %"425_1.sroa.10.0.i.i", 9 %236 = lshr i64 %235, 6 - %237 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %236 + %237 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %236 %238 = load i64, ptr %237, align 4 %239 = and i64 %235, 63 %240 = lshr i64 %238, %239 %241 = trunc i64 %240 to i1 - br i1 %241, label %cond_exit_424.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i + br i1 %241, label %cond_exit_428.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_424.thread.8.i.i +__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_428.thread.8.i.i %242 = shl nuw i64 1, %239 %243 = xor i64 %238, %242 store i64 %243, ptr %237, align 4 - %244 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %235 + %244 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %235 %245 = load i64, ptr %244, align 4 tail call void @___dec_future_refcount(i64 %245) - br label %cond_exit_424.thread.9.i.i + br label %cond_exit_428.thread.9.i.i -cond_exit_424.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_424.thread.8.i.i +cond_exit_428.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_428.thread.8.i.i %246 = load i64, ptr %118, align 4 %247 = sub nuw nsw i64 64, %120 %248 = lshr i64 -1, %247 @@ -687,9 +687,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %124, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_424.thread.9.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_428.thread.9.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %115) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_helios index f2b5f469f..8724ed2d5 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.19.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_helios index 1d715c2b8..d5043d180 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = 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_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit -cond_44_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.44.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.44.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.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_helios index 1f70f438c..4315ef9f5 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = 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_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.42.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.42.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.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_helios index 90f7fa4f5..12748e333 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) + %shot.i.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_helios index 1a40d3132..975d940a0 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_helios @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_600_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_604_case_0.i, label %__barray_check_bounds.exit -cond_600_case_0.i: ; preds = %cond_20_case_1 +cond_604_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"620_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"620_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"620_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"624_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"624_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"624_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_623_case_0.i.i: ; preds = %cond_exit_623.thread.i.i - %85 = lshr i64 %"620_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"620_1.sroa.5.0.i.i", i64 %85 +cond_627_case_0.i.i: ; preds = %cond_exit_627.thread.i.i + %85 = lshr i64 %"624_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"624_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"620_1.sroa.10.0.i.i", 63 + %88 = and i64 %"624_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"620_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"624_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_623_case_0.i.i: ; preds = %cond_exit_623.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_623_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_623_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_627_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_627_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_623.thread.i.i, %loop_body.preheader.i.i - %"620_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_623.thread.i.i ] - %106 = add nuw nsw i64 %"620_0.0239.i.i", 1 - %107 = add i64 %"620_0.0239.i.i", %"620_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_627.thread.i.i, %loop_body.preheader.i.i + %"624_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_627.thread.i.i ] + %106 = add nuw nsw i64 %"624_0.0239.i.i", 1 + %107 = add i64 %"624_0.0239.i.i", %"624_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_623.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_627.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"620_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"624_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_623.thread.i.i + br label %cond_exit_627.thread.i.i -cond_exit_623.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_627.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_623_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_627_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_623_case_0.i.i - tail call void @heap_free(ptr %"620_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"620_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_627_case_0.i.i + tail call void @heap_free(ptr %"624_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"624_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_helios index 33778e1c4..b4f2f1b5a 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] +__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i -1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios index 3b5b2cc70..99def9f6c 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios @@ -14,9 +14,9 @@ alloca_block: 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_225_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_229_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) @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_229_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) @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_229_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) @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_229_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) @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_229_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) @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_229_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) @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_229_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) @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_229_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) @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_229_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios index b9395ee0c..4419a24f9 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.40.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_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34) %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_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios index f7700f247..4b1693296 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios @@ -15,9 +15,9 @@ alloca_block: 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_401_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_405_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) @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_405_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) @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_405_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) @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_405_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) @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_405_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) @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_405_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) @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_405_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) @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_405_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) @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_405_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) @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i - %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6 - %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136 +cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i + %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6 + %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136 %138 = load i64, ptr %137, align 4 - %139 = and i64 %"421_1.sroa.10.0.i.i", 63 + %139 = and i64 %"425_1.sroa.10.0.i.i", 63 %140 = sub nuw nsw i64 64, %139 %141 = lshr i64 -1, %140 %142 = icmp eq i64 %139, 0 %143 = select i1 %142, i64 0, i64 %141 %144 = or i64 %138, %143 store i64 %144, ptr %137, align 4 - %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9 + %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9 %145 = lshr i64 %last_valid.i.i.i179, 6 - %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145 + %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145 %147 = load i64, ptr %146, align 4 %148 = and i64 %last_valid.i.i.i179, 63 %149 = shl nsw i64 -2, %148 @@ -474,8 +474,8 @@ cond_424_case_0.i.i: ; preds = %cond_exit_424.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182 -mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183 %155 = load i64, ptr %gep.i.i.i184, align 4 %156 = icmp eq i64 %155, -1 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i - %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] - %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 - %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i + %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] + %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 + %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162 %166 = xor i64 %165, %161 store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios index 26cda875b..0b60b94f0 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.19.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios index f2a9f612a..7ac62a610 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = 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_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit -cond_44_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.44.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.44.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.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios index e45703d74..eb1c2747d 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = 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_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.42.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.42.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.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios index bba6354c9..f20a49f19 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) + %shot.i.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_helios index b460adff0..a4871556e 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_helios @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_600_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_604_case_0.i, label %__barray_check_bounds.exit -cond_600_case_0.i: ; preds = %cond_20_case_1 +cond_604_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"620_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"620_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"620_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"624_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"624_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"624_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_623_case_0.i.i: ; preds = %cond_exit_623.thread.i.i - %85 = lshr i64 %"620_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"620_1.sroa.5.0.i.i", i64 %85 +cond_627_case_0.i.i: ; preds = %cond_exit_627.thread.i.i + %85 = lshr i64 %"624_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"624_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"620_1.sroa.10.0.i.i", 63 + %88 = and i64 %"624_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"620_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"624_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_623_case_0.i.i: ; preds = %cond_exit_623.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_623_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_623_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_627_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_627_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_623.thread.i.i, %loop_body.preheader.i.i - %"620_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_623.thread.i.i ] - %106 = add nuw nsw i64 %"620_0.0239.i.i", 1 - %107 = add i64 %"620_0.0239.i.i", %"620_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_627.thread.i.i, %loop_body.preheader.i.i + %"624_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_627.thread.i.i ] + %106 = add nuw nsw i64 %"624_0.0239.i.i", 1 + %107 = add i64 %"624_0.0239.i.i", %"624_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_623.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_627.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"620_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"624_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_623.thread.i.i + br label %cond_exit_627.thread.i.i -cond_exit_623.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_627.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_623_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_627_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_623_case_0.i.i - tail call void @heap_free(ptr %"620_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"620_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_627_case_0.i.i + tail call void @heap_free(ptr %"624_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"624_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios index a835a7874..8eae86370 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] +__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i -1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios index 78b7740fa..4c9358de7 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios @@ -14,9 +14,9 @@ alloca_block: 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_225_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_229_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) @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_229_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) @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_229_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) @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_229_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) @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_229_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) @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_229_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) @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_229_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) @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_229_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) @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_229_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios index 09f6057d1..06718b8c8 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.40.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_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34) %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_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios index a0fb175f3..5f42b80f4 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios @@ -15,9 +15,9 @@ alloca_block: 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_401_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_405_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) @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_405_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) @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_405_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) @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_405_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) @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_405_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) @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_405_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) @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_405_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) @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_405_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) @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_405_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) @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i - %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6 - %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136 +cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i + %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6 + %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136 %138 = load i64, ptr %137, align 4 - %139 = and i64 %"421_1.sroa.10.0.i.i", 63 + %139 = and i64 %"425_1.sroa.10.0.i.i", 63 %140 = sub nuw nsw i64 64, %139 %141 = lshr i64 -1, %140 %142 = icmp eq i64 %139, 0 %143 = select i1 %142, i64 0, i64 %141 %144 = or i64 %138, %143 store i64 %144, ptr %137, align 4 - %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9 + %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9 %145 = lshr i64 %last_valid.i.i.i179, 6 - %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145 + %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145 %147 = load i64, ptr %146, align 4 %148 = and i64 %last_valid.i.i.i179, 63 %149 = shl nsw i64 -2, %148 @@ -474,8 +474,8 @@ cond_424_case_0.i.i: ; preds = %cond_exit_424.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182 -mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183 %155 = load i64, ptr %gep.i.i.i184, align 4 %156 = icmp eq i64 %155, -1 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i - %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] - %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 - %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i + %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] + %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 + %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162 %166 = xor i64 %165, %161 store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios index bba38b92e..da0873232 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.19.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios index 2e1ec69b0..94cd2e71f 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = 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_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit -cond_44_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.44.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.44.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.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios index ebcb4e84c..e93b19b01 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = 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_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.42.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.42.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.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios index 9bc08ebcc..700c1e4e4 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) + %shot.i.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_helios index 208997985..d8bfa84d4 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_helios @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_600_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_604_case_0.i, label %__barray_check_bounds.exit -cond_600_case_0.i: ; preds = %cond_20_case_1 +cond_604_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"620_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"620_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"620_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"624_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"624_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"624_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_623_case_0.i.i: ; preds = %cond_exit_623.thread.i.i - %85 = lshr i64 %"620_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"620_1.sroa.5.0.i.i", i64 %85 +cond_627_case_0.i.i: ; preds = %cond_exit_627.thread.i.i + %85 = lshr i64 %"624_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"624_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"620_1.sroa.10.0.i.i", 63 + %88 = and i64 %"624_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"620_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"624_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_623_case_0.i.i: ; preds = %cond_exit_623.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_623_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_623_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_627_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_627_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_623.thread.i.i, %loop_body.preheader.i.i - %"620_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_623.thread.i.i ] - %106 = add nuw nsw i64 %"620_0.0239.i.i", 1 - %107 = add i64 %"620_0.0239.i.i", %"620_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_627.thread.i.i, %loop_body.preheader.i.i + %"624_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_627.thread.i.i ] + %106 = add nuw nsw i64 %"624_0.0239.i.i", 1 + %107 = add i64 %"624_0.0239.i.i", %"624_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_623.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_627.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"620_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"624_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_623.thread.i.i + br label %cond_exit_627.thread.i.i -cond_exit_623.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_627.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_623_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_627_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_623_case_0.i.i - tail call void @heap_free(ptr %"620_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"620_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_627_case_0.i.i + tail call void @heap_free(ptr %"624_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"624_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios index 904aabb2e..2af68c73a 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] +__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i -1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios index 1b58e0b9e..df8c7e0f5 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios @@ -14,9 +14,9 @@ alloca_block: 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_225_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_229_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) @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_229_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) @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_229_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) @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_229_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) @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_229_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) @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_229_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) @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_229_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) @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_229_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) @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_229_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios index 301c3cff0..258cf2626 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.40.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_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit +__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34) %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_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 +__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 +__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios index 2218b7649..2fbaa2a11 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios @@ -15,9 +15,9 @@ alloca_block: 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_401_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_405_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) @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_405_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) @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_405_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) @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_405_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) @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_405_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) @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_405_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) @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_405_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) @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_405_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) @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_405_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) @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i - %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6 - %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136 +cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i + %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6 + %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136 %138 = load i64, ptr %137, align 4 - %139 = and i64 %"421_1.sroa.10.0.i.i", 63 + %139 = and i64 %"425_1.sroa.10.0.i.i", 63 %140 = sub nuw nsw i64 64, %139 %141 = lshr i64 -1, %140 %142 = icmp eq i64 %139, 0 %143 = select i1 %142, i64 0, i64 %141 %144 = or i64 %138, %143 store i64 %144, ptr %137, align 4 - %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9 + %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9 %145 = lshr i64 %last_valid.i.i.i179, 6 - %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145 + %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145 %147 = load i64, ptr %146, align 4 %148 = and i64 %last_valid.i.i.i179, 63 %149 = shl nsw i64 -2, %148 @@ -474,8 +474,8 @@ cond_424_case_0.i.i: ; preds = %cond_exit_424.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182 -mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183 %155 = load i64, ptr %gep.i.i.i184, align 4 %156 = icmp eq i64 %155, -1 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i - %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] - %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 - %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i + %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] + %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 + %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162 %166 = xor i64 %165, %161 store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios index 226b3219f..003c93dd3 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.19.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios index 966122f7f..50b211302 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = 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_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit -cond_44_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.44.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.44.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.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios index b32806379..60d3ab1f5 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = 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_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.42.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.42.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.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios index bcf269ecd..9a78b61f0 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) + %shot.i.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_helios index 086679d4f..3e37e7e04 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_helios @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_600_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_604_case_0.i, label %__barray_check_bounds.exit -cond_600_case_0.i: ; preds = %cond_20_case_1 +cond_604_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"620_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"620_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"620_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"624_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"624_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"624_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_623_case_0.i.i: ; preds = %cond_exit_623.thread.i.i - %85 = lshr i64 %"620_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"620_1.sroa.5.0.i.i", i64 %85 +cond_627_case_0.i.i: ; preds = %cond_exit_627.thread.i.i + %85 = lshr i64 %"624_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"624_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"620_1.sroa.10.0.i.i", 63 + %88 = and i64 %"624_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"620_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"624_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_623_case_0.i.i: ; preds = %cond_exit_623.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_623_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_623_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_627_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_627_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_623.thread.i.i, %loop_body.preheader.i.i - %"620_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_623.thread.i.i ] - %106 = add nuw nsw i64 %"620_0.0239.i.i", 1 - %107 = add i64 %"620_0.0239.i.i", %"620_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_627.thread.i.i, %loop_body.preheader.i.i + %"624_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_627.thread.i.i ] + %106 = add nuw nsw i64 %"624_0.0239.i.i", 1 + %107 = add i64 %"624_0.0239.i.i", %"624_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_623.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_627.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"620_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"624_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_623.thread.i.i + br label %cond_exit_627.thread.i.i -cond_exit_623.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_627.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_623_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_627_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_623_case_0.i.i - tail call void @heap_free(ptr %"620_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"620_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_627_case_0.i.i + tail call void @heap_free(ptr %"624_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"624_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios index 5e2429954..a70812002 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] +__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i +__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i -1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol index c258f5863..e19d1bf57 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol @@ -14,157 +14,157 @@ alloca_block: 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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.221.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.225.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.9, %__hugr__.__tk2_sol_qalloc.221.exit.8, %__hugr__.__tk2_sol_qalloc.221.exit.7, %__hugr__.__tk2_sol_qalloc.221.exit.6, %__hugr__.__tk2_sol_qalloc.221.exit.5, %__hugr__.__tk2_sol_qalloc.221.exit.4, %__hugr__.__tk2_sol_qalloc.221.exit.3, %__hugr__.__tk2_sol_qalloc.221.exit.2, %__hugr__.__tk2_sol_qalloc.221.exit.1, %__hugr__.__tk2_sol_qalloc.221.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.225.exit.8, %__hugr__.__tk2_sol_qalloc.225.exit.7, %__hugr__.__tk2_sol_qalloc.225.exit.6, %__hugr__.__tk2_sol_qalloc.225.exit.5, %__hugr__.__tk2_sol_qalloc.225.exit.4, %__hugr__.__tk2_sol_qalloc.225.exit.3, %__hugr__.__tk2_sol_qalloc.225.exit.2, %__hugr__.__tk2_sol_qalloc.225.exit.1, %__hugr__.__tk2_sol_qalloc.225.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit +cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.1 + br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.1 -__hugr__.__tk2_sol_qalloc.221.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.225.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.221.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.2 + br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.2 -__hugr__.__tk2_sol_qalloc.221.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.225.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 %.not117 = icmp eq i64 %10, 0 br i1 %.not117, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.3 + br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.3 -__hugr__.__tk2_sol_qalloc.221.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.225.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 %.not118 = icmp eq i64 %14, 0 br i1 %.not118, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.4 + br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.4 -__hugr__.__tk2_sol_qalloc.221.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.225.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 %.not119 = icmp eq i64 %18, 0 br i1 %.not119, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.5 + br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.5 -__hugr__.__tk2_sol_qalloc.221.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.225.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 %.not120 = icmp eq i64 %22, 0 br i1 %.not120, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.6 + br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.6 -__hugr__.__tk2_sol_qalloc.221.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.225.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 %.not121 = icmp eq i64 %26, 0 br i1 %.not121, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.7 + br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.7 -__hugr__.__tk2_sol_qalloc.221.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.225.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 %.not122 = icmp eq i64 %30, 0 br i1 %.not122, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.8 + br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.8 -__hugr__.__tk2_sol_qalloc.221.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.225.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 %.not123 = icmp eq i64 %34, 0 br i1 %.not123, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_229_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol index 02aca59c0..06c0be359 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.40.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_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34) %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_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol index 6a33d1e9d..8014ccc7f 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol @@ -15,157 +15,157 @@ alloca_block: 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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.374.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.378.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.9, %__hugr__.__tk2_sol_qalloc.374.exit.8, %__hugr__.__tk2_sol_qalloc.374.exit.7, %__hugr__.__tk2_sol_qalloc.374.exit.6, %__hugr__.__tk2_sol_qalloc.374.exit.5, %__hugr__.__tk2_sol_qalloc.374.exit.4, %__hugr__.__tk2_sol_qalloc.374.exit.3, %__hugr__.__tk2_sol_qalloc.374.exit.2, %__hugr__.__tk2_sol_qalloc.374.exit.1, %__hugr__.__tk2_sol_qalloc.374.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.378.exit.8, %__hugr__.__tk2_sol_qalloc.378.exit.7, %__hugr__.__tk2_sol_qalloc.378.exit.6, %__hugr__.__tk2_sol_qalloc.378.exit.5, %__hugr__.__tk2_sol_qalloc.378.exit.4, %__hugr__.__tk2_sol_qalloc.378.exit.3, %__hugr__.__tk2_sol_qalloc.378.exit.2, %__hugr__.__tk2_sol_qalloc.378.exit.1, %__hugr__.__tk2_sol_qalloc.378.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit +cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.1 + br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.1 -__hugr__.__tk2_sol_qalloc.374.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.378.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 %.not199 = icmp eq i64 %6, 0 br i1 %.not199, label %panic.i, label %cond_exit_20.1 -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.2 + br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.2 -__hugr__.__tk2_sol_qalloc.374.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.378.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 %.not200 = icmp eq i64 %10, 0 br i1 %.not200, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.3 + br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.3 -__hugr__.__tk2_sol_qalloc.374.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.378.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 %.not201 = icmp eq i64 %14, 0 br i1 %.not201, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.4 + br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.4 -__hugr__.__tk2_sol_qalloc.374.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.378.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 %.not202 = icmp eq i64 %18, 0 br i1 %.not202, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.5 + br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.5 -__hugr__.__tk2_sol_qalloc.374.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.378.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 %.not203 = icmp eq i64 %22, 0 br i1 %.not203, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.6 + br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.6 -__hugr__.__tk2_sol_qalloc.374.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.378.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 %.not204 = icmp eq i64 %26, 0 br i1 %.not204, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.7 + br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.7 -__hugr__.__tk2_sol_qalloc.374.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.378.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 %.not205 = icmp eq i64 %30, 0 br i1 %.not205, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.8 + br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.8 -__hugr__.__tk2_sol_qalloc.374.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.378.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 %.not206 = icmp eq i64 %34, 0 br i1 %.not206, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_405_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) @@ -399,16 +399,16 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 - %117 = lshr i64 %"421_1.sroa.10.0.i.i", 6 - %118 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %117 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 + %117 = lshr i64 %"425_1.sroa.10.0.i.i", 6 + %118 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %117 %119 = load i64, ptr %118, align 4 - %120 = and i64 %"421_1.sroa.10.0.i.i", 63 + %120 = and i64 %"425_1.sroa.10.0.i.i", 63 %121 = lshr i64 %119, %120 %122 = trunc i64 %121 to i1 - br i1 %122, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %122, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" %123 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" ], [ %265, %loop_body.i177 ] @@ -452,8 +452,8 @@ panic.i222.i.i: ; preds = %__barray_check_boun %exitcond.not.i.i.i185 = icmp eq i64 %.02.i.i.i182, %reass.sub.i.i.i179 br i1 %exitcond.not.i.i.i185, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i181 -mask_block_ok.i.i.i181: ; preds = %cond_exit_424.thread.9.i.i, %139 - %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_424.thread.9.i.i ] +mask_block_ok.i.i.i181: ; preds = %cond_exit_428.thread.9.i.i, %139 + %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_428.thread.9.i.i ] %gep.i.i.i183 = getelementptr i64, ptr %118, i64 %.02.i.i.i182 %141 = load i64, ptr %gep.i.i.i183, align 4 %142 = icmp eq i64 %141, -1 @@ -467,183 +467,183 @@ __barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader %143 = shl nuw i64 1, %120 %144 = xor i64 %119, %143 store i64 %144, ptr %118, align 4 - %145 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %"421_1.sroa.10.0.i.i" + %145 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %"425_1.sroa.10.0.i.i" %146 = load i64, ptr %145, align 4 tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %147 = add i64 %"421_1.sroa.10.0.i.i", 1 +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i + %147 = add i64 %"425_1.sroa.10.0.i.i", 1 %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %148 + %149 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i + br i1 %153, label %cond_exit_428.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_424.thread.i.i +__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_428.thread.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 %"421_1.sroa.0.0.i.i", i64 %147 + %156 = getelementptr inbounds i64, ptr %"425_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_424.thread.1.i.i + br label %cond_exit_428.thread.1.i.i -cond_exit_424.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_424.thread.i.i - %158 = add i64 %"421_1.sroa.10.0.i.i", 2 +cond_exit_428.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_428.thread.i.i + %158 = add i64 %"425_1.sroa.10.0.i.i", 2 %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i + br i1 %164, label %cond_exit_428.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_424.thread.1.i.i +__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_428.thread.1.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 %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.2.i.i + br label %cond_exit_428.thread.2.i.i -cond_exit_424.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_424.thread.1.i.i - %169 = add i64 %"421_1.sroa.10.0.i.i", 3 +cond_exit_428.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_428.thread.1.i.i + %169 = add i64 %"425_1.sroa.10.0.i.i", 3 %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %170 + %171 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i + br i1 %175, label %cond_exit_428.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_424.thread.2.i.i +__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_428.thread.2.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 %"421_1.sroa.0.0.i.i", i64 %169 + %178 = getelementptr inbounds i64, ptr %"425_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_424.thread.3.i.i + br label %cond_exit_428.thread.3.i.i -cond_exit_424.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_424.thread.2.i.i - %180 = add i64 %"421_1.sroa.10.0.i.i", 4 +cond_exit_428.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_428.thread.2.i.i + %180 = add i64 %"425_1.sroa.10.0.i.i", 4 %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %181 + %182 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i + br i1 %186, label %cond_exit_428.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_424.thread.3.i.i +__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_428.thread.3.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 %"421_1.sroa.0.0.i.i", i64 %180 + %189 = getelementptr inbounds i64, ptr %"425_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_424.thread.4.i.i + br label %cond_exit_428.thread.4.i.i -cond_exit_424.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_424.thread.3.i.i - %191 = add i64 %"421_1.sroa.10.0.i.i", 5 +cond_exit_428.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_428.thread.3.i.i + %191 = add i64 %"425_1.sroa.10.0.i.i", 5 %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %192 + %193 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i + br i1 %197, label %cond_exit_428.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_424.thread.4.i.i +__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_428.thread.4.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 %"421_1.sroa.0.0.i.i", i64 %191 + %200 = getelementptr inbounds i64, ptr %"425_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_424.thread.5.i.i + br label %cond_exit_428.thread.5.i.i -cond_exit_424.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_424.thread.4.i.i - %202 = add i64 %"421_1.sroa.10.0.i.i", 6 +cond_exit_428.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_428.thread.4.i.i + %202 = add i64 %"425_1.sroa.10.0.i.i", 6 %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %203 + %204 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i + br i1 %208, label %cond_exit_428.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_424.thread.5.i.i +__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_428.thread.5.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 %"421_1.sroa.0.0.i.i", i64 %202 + %211 = getelementptr inbounds i64, ptr %"425_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_424.thread.6.i.i + br label %cond_exit_428.thread.6.i.i -cond_exit_424.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_424.thread.5.i.i - %213 = add i64 %"421_1.sroa.10.0.i.i", 7 +cond_exit_428.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_428.thread.5.i.i + %213 = add i64 %"425_1.sroa.10.0.i.i", 7 %214 = lshr i64 %213, 6 - %215 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %214 + %215 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %214 %216 = load i64, ptr %215, align 4 %217 = and i64 %213, 63 %218 = lshr i64 %216, %217 %219 = trunc i64 %218 to i1 - br i1 %219, label %cond_exit_424.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i + br i1 %219, label %cond_exit_428.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_424.thread.6.i.i +__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_428.thread.6.i.i %220 = shl nuw i64 1, %217 %221 = xor i64 %216, %220 store i64 %221, ptr %215, align 4 - %222 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %213 + %222 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %213 %223 = load i64, ptr %222, align 4 tail call void @___dec_future_refcount(i64 %223) - br label %cond_exit_424.thread.7.i.i + br label %cond_exit_428.thread.7.i.i -cond_exit_424.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_424.thread.6.i.i - %224 = add i64 %"421_1.sroa.10.0.i.i", 8 +cond_exit_428.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_428.thread.6.i.i + %224 = add i64 %"425_1.sroa.10.0.i.i", 8 %225 = lshr i64 %224, 6 - %226 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %225 + %226 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %225 %227 = load i64, ptr %226, align 4 %228 = and i64 %224, 63 %229 = lshr i64 %227, %228 %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_424.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i + br i1 %230, label %cond_exit_428.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_424.thread.7.i.i +__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_428.thread.7.i.i %231 = shl nuw i64 1, %228 %232 = xor i64 %227, %231 store i64 %232, ptr %226, align 4 - %233 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %224 + %233 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %224 %234 = load i64, ptr %233, align 4 tail call void @___dec_future_refcount(i64 %234) - br label %cond_exit_424.thread.8.i.i + br label %cond_exit_428.thread.8.i.i -cond_exit_424.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_424.thread.7.i.i - %235 = add i64 %"421_1.sroa.10.0.i.i", 9 +cond_exit_428.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_428.thread.7.i.i + %235 = add i64 %"425_1.sroa.10.0.i.i", 9 %236 = lshr i64 %235, 6 - %237 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %236 + %237 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %236 %238 = load i64, ptr %237, align 4 %239 = and i64 %235, 63 %240 = lshr i64 %238, %239 %241 = trunc i64 %240 to i1 - br i1 %241, label %cond_exit_424.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i + br i1 %241, label %cond_exit_428.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_424.thread.8.i.i +__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_428.thread.8.i.i %242 = shl nuw i64 1, %239 %243 = xor i64 %238, %242 store i64 %243, ptr %237, align 4 - %244 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %235 + %244 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %235 %245 = load i64, ptr %244, align 4 tail call void @___dec_future_refcount(i64 %245) - br label %cond_exit_424.thread.9.i.i + br label %cond_exit_428.thread.9.i.i -cond_exit_424.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_424.thread.8.i.i +cond_exit_428.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_428.thread.8.i.i %246 = load i64, ptr %118, align 4 %247 = sub nuw nsw i64 64, %120 %248 = lshr i64 -1, %247 @@ -687,9 +687,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %124, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_424.thread.9.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_428.thread.9.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %115) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol index 552850cba..ef8bf0919 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.19.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol index bc1098e4b..8886b03d0 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = 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_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit -cond_44_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.44.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.44.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.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol index 3b59ef86f..d0b00e579 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = 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_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.42.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.42.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.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol index 4fed018b2..90be7a009 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) + %shot.i.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_sol index e8b4a6b2d..491f8a5f7 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_sol @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_612_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_616_case_0.i, label %__barray_check_bounds.exit -cond_612_case_0.i: ; preds = %cond_20_case_1 +cond_616_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"632_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"632_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"632_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"636_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"636_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"636_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_635_case_0.i.i: ; preds = %cond_exit_635.thread.i.i - %85 = lshr i64 %"632_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"632_1.sroa.5.0.i.i", i64 %85 +cond_639_case_0.i.i: ; preds = %cond_exit_639.thread.i.i + %85 = lshr i64 %"636_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"636_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"632_1.sroa.10.0.i.i", 63 + %88 = and i64 %"636_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"632_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"636_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_635_case_0.i.i: ; preds = %cond_exit_635.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_635_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_635_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_639_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_639_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_635.thread.i.i, %loop_body.preheader.i.i - %"632_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_635.thread.i.i ] - %106 = add nuw nsw i64 %"632_0.0239.i.i", 1 - %107 = add i64 %"632_0.0239.i.i", %"632_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_639.thread.i.i, %loop_body.preheader.i.i + %"636_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_639.thread.i.i ] + %106 = add nuw nsw i64 %"636_0.0239.i.i", 1 + %107 = add i64 %"636_0.0239.i.i", %"636_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_635.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_639.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"632_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"636_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_635.thread.i.i + br label %cond_exit_639.thread.i.i -cond_exit_635.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_639.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_635_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_639_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_635_case_0.i.i - tail call void @heap_free(ptr %"632_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"632_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_639_case_0.i.i + tail call void @heap_free(ptr %"636_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"636_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol index 5610bb07a..56dc8b57e 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] +__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i -1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i 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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_sol index 88145546e..85ba5bbc6 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_sol @@ -14,157 +14,157 @@ alloca_block: 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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.221.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.225.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.9, %__hugr__.__tk2_sol_qalloc.221.exit.8, %__hugr__.__tk2_sol_qalloc.221.exit.7, %__hugr__.__tk2_sol_qalloc.221.exit.6, %__hugr__.__tk2_sol_qalloc.221.exit.5, %__hugr__.__tk2_sol_qalloc.221.exit.4, %__hugr__.__tk2_sol_qalloc.221.exit.3, %__hugr__.__tk2_sol_qalloc.221.exit.2, %__hugr__.__tk2_sol_qalloc.221.exit.1, %__hugr__.__tk2_sol_qalloc.221.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.225.exit.8, %__hugr__.__tk2_sol_qalloc.225.exit.7, %__hugr__.__tk2_sol_qalloc.225.exit.6, %__hugr__.__tk2_sol_qalloc.225.exit.5, %__hugr__.__tk2_sol_qalloc.225.exit.4, %__hugr__.__tk2_sol_qalloc.225.exit.3, %__hugr__.__tk2_sol_qalloc.225.exit.2, %__hugr__.__tk2_sol_qalloc.225.exit.1, %__hugr__.__tk2_sol_qalloc.225.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit +cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.1 + br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.1 -__hugr__.__tk2_sol_qalloc.221.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.225.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.221.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.2 + br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.2 -__hugr__.__tk2_sol_qalloc.221.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.225.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 %.not117 = icmp eq i64 %10, 0 br i1 %.not117, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.3 + br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.3 -__hugr__.__tk2_sol_qalloc.221.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.225.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 %.not118 = icmp eq i64 %14, 0 br i1 %.not118, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.4 + br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.4 -__hugr__.__tk2_sol_qalloc.221.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.225.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 %.not119 = icmp eq i64 %18, 0 br i1 %.not119, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.5 + br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.5 -__hugr__.__tk2_sol_qalloc.221.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.225.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 %.not120 = icmp eq i64 %22, 0 br i1 %.not120, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.6 + br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.6 -__hugr__.__tk2_sol_qalloc.221.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.225.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 %.not121 = icmp eq i64 %26, 0 br i1 %.not121, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.7 + br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.7 -__hugr__.__tk2_sol_qalloc.221.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.225.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 %.not122 = icmp eq i64 %30, 0 br i1 %.not122, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.8 + br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.8 -__hugr__.__tk2_sol_qalloc.221.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.225.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 %.not123 = icmp eq i64 %34, 0 br i1 %.not123, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.221.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.225.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_225_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_229_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_sol index 77772a5aa..360d9b5bd 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.40.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_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34) %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_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_sol index 365a31eac..e3eba2507 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_sol @@ -15,157 +15,157 @@ alloca_block: 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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.374.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.378.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.9, %__hugr__.__tk2_sol_qalloc.374.exit.8, %__hugr__.__tk2_sol_qalloc.374.exit.7, %__hugr__.__tk2_sol_qalloc.374.exit.6, %__hugr__.__tk2_sol_qalloc.374.exit.5, %__hugr__.__tk2_sol_qalloc.374.exit.4, %__hugr__.__tk2_sol_qalloc.374.exit.3, %__hugr__.__tk2_sol_qalloc.374.exit.2, %__hugr__.__tk2_sol_qalloc.374.exit.1, %__hugr__.__tk2_sol_qalloc.374.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.378.exit.8, %__hugr__.__tk2_sol_qalloc.378.exit.7, %__hugr__.__tk2_sol_qalloc.378.exit.6, %__hugr__.__tk2_sol_qalloc.378.exit.5, %__hugr__.__tk2_sol_qalloc.378.exit.4, %__hugr__.__tk2_sol_qalloc.378.exit.3, %__hugr__.__tk2_sol_qalloc.378.exit.2, %__hugr__.__tk2_sol_qalloc.378.exit.1, %__hugr__.__tk2_sol_qalloc.378.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit +cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.1 + br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.1 -__hugr__.__tk2_sol_qalloc.374.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.378.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 %.not199 = icmp eq i64 %6, 0 br i1 %.not199, label %panic.i, label %cond_exit_20.1 -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.2 + br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.2 -__hugr__.__tk2_sol_qalloc.374.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.378.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 %.not200 = icmp eq i64 %10, 0 br i1 %.not200, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.3 + br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.3 -__hugr__.__tk2_sol_qalloc.374.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.378.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 %.not201 = icmp eq i64 %14, 0 br i1 %.not201, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.4 + br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.4 -__hugr__.__tk2_sol_qalloc.374.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.378.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 %.not202 = icmp eq i64 %18, 0 br i1 %.not202, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.5 + br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.5 -__hugr__.__tk2_sol_qalloc.374.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.378.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 %.not203 = icmp eq i64 %22, 0 br i1 %.not203, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.6 + br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.6 -__hugr__.__tk2_sol_qalloc.374.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.378.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 %.not204 = icmp eq i64 %26, 0 br i1 %.not204, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.7 + br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.7 -__hugr__.__tk2_sol_qalloc.374.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.378.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 %.not205 = icmp eq i64 %30, 0 br i1 %.not205, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.8 + br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.8 -__hugr__.__tk2_sol_qalloc.374.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.378.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 %.not206 = icmp eq i64 %34, 0 br i1 %.not206, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.374.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.378.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_401_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_405_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) @@ -399,16 +399,16 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 - %117 = lshr i64 %"421_1.sroa.10.0.i.i", 6 - %118 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %117 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 + %117 = lshr i64 %"425_1.sroa.10.0.i.i", 6 + %118 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %117 %119 = load i64, ptr %118, align 4 - %120 = and i64 %"421_1.sroa.10.0.i.i", 63 + %120 = and i64 %"425_1.sroa.10.0.i.i", 63 %121 = lshr i64 %119, %120 %122 = trunc i64 %121 to i1 - br i1 %122, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %122, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" %123 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" ], [ %265, %loop_body.i177 ] @@ -452,8 +452,8 @@ panic.i222.i.i: ; preds = %__barray_check_boun %exitcond.not.i.i.i185 = icmp eq i64 %.02.i.i.i182, %reass.sub.i.i.i179 br i1 %exitcond.not.i.i.i185, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i181 -mask_block_ok.i.i.i181: ; preds = %cond_exit_424.thread.9.i.i, %139 - %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_424.thread.9.i.i ] +mask_block_ok.i.i.i181: ; preds = %cond_exit_428.thread.9.i.i, %139 + %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_428.thread.9.i.i ] %gep.i.i.i183 = getelementptr i64, ptr %118, i64 %.02.i.i.i182 %141 = load i64, ptr %gep.i.i.i183, align 4 %142 = icmp eq i64 %141, -1 @@ -467,183 +467,183 @@ __barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader %143 = shl nuw i64 1, %120 %144 = xor i64 %119, %143 store i64 %144, ptr %118, align 4 - %145 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %"421_1.sroa.10.0.i.i" + %145 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %"425_1.sroa.10.0.i.i" %146 = load i64, ptr %145, align 4 tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %147 = add i64 %"421_1.sroa.10.0.i.i", 1 +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i + %147 = add i64 %"425_1.sroa.10.0.i.i", 1 %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %148 + %149 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i + br i1 %153, label %cond_exit_428.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_424.thread.i.i +__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_428.thread.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 %"421_1.sroa.0.0.i.i", i64 %147 + %156 = getelementptr inbounds i64, ptr %"425_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_424.thread.1.i.i + br label %cond_exit_428.thread.1.i.i -cond_exit_424.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_424.thread.i.i - %158 = add i64 %"421_1.sroa.10.0.i.i", 2 +cond_exit_428.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_428.thread.i.i + %158 = add i64 %"425_1.sroa.10.0.i.i", 2 %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i + br i1 %164, label %cond_exit_428.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_424.thread.1.i.i +__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_428.thread.1.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 %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.2.i.i + br label %cond_exit_428.thread.2.i.i -cond_exit_424.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_424.thread.1.i.i - %169 = add i64 %"421_1.sroa.10.0.i.i", 3 +cond_exit_428.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_428.thread.1.i.i + %169 = add i64 %"425_1.sroa.10.0.i.i", 3 %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %170 + %171 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i + br i1 %175, label %cond_exit_428.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_424.thread.2.i.i +__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_428.thread.2.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 %"421_1.sroa.0.0.i.i", i64 %169 + %178 = getelementptr inbounds i64, ptr %"425_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_424.thread.3.i.i + br label %cond_exit_428.thread.3.i.i -cond_exit_424.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_424.thread.2.i.i - %180 = add i64 %"421_1.sroa.10.0.i.i", 4 +cond_exit_428.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_428.thread.2.i.i + %180 = add i64 %"425_1.sroa.10.0.i.i", 4 %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %181 + %182 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i + br i1 %186, label %cond_exit_428.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_424.thread.3.i.i +__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_428.thread.3.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 %"421_1.sroa.0.0.i.i", i64 %180 + %189 = getelementptr inbounds i64, ptr %"425_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_424.thread.4.i.i + br label %cond_exit_428.thread.4.i.i -cond_exit_424.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_424.thread.3.i.i - %191 = add i64 %"421_1.sroa.10.0.i.i", 5 +cond_exit_428.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_428.thread.3.i.i + %191 = add i64 %"425_1.sroa.10.0.i.i", 5 %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %192 + %193 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i + br i1 %197, label %cond_exit_428.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_424.thread.4.i.i +__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_428.thread.4.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 %"421_1.sroa.0.0.i.i", i64 %191 + %200 = getelementptr inbounds i64, ptr %"425_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_424.thread.5.i.i + br label %cond_exit_428.thread.5.i.i -cond_exit_424.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_424.thread.4.i.i - %202 = add i64 %"421_1.sroa.10.0.i.i", 6 +cond_exit_428.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_428.thread.4.i.i + %202 = add i64 %"425_1.sroa.10.0.i.i", 6 %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %203 + %204 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i + br i1 %208, label %cond_exit_428.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_424.thread.5.i.i +__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_428.thread.5.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 %"421_1.sroa.0.0.i.i", i64 %202 + %211 = getelementptr inbounds i64, ptr %"425_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_424.thread.6.i.i + br label %cond_exit_428.thread.6.i.i -cond_exit_424.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_424.thread.5.i.i - %213 = add i64 %"421_1.sroa.10.0.i.i", 7 +cond_exit_428.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_428.thread.5.i.i + %213 = add i64 %"425_1.sroa.10.0.i.i", 7 %214 = lshr i64 %213, 6 - %215 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %214 + %215 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %214 %216 = load i64, ptr %215, align 4 %217 = and i64 %213, 63 %218 = lshr i64 %216, %217 %219 = trunc i64 %218 to i1 - br i1 %219, label %cond_exit_424.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i + br i1 %219, label %cond_exit_428.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_424.thread.6.i.i +__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_428.thread.6.i.i %220 = shl nuw i64 1, %217 %221 = xor i64 %216, %220 store i64 %221, ptr %215, align 4 - %222 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %213 + %222 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %213 %223 = load i64, ptr %222, align 4 tail call void @___dec_future_refcount(i64 %223) - br label %cond_exit_424.thread.7.i.i + br label %cond_exit_428.thread.7.i.i -cond_exit_424.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_424.thread.6.i.i - %224 = add i64 %"421_1.sroa.10.0.i.i", 8 +cond_exit_428.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_428.thread.6.i.i + %224 = add i64 %"425_1.sroa.10.0.i.i", 8 %225 = lshr i64 %224, 6 - %226 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %225 + %226 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %225 %227 = load i64, ptr %226, align 4 %228 = and i64 %224, 63 %229 = lshr i64 %227, %228 %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_424.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i + br i1 %230, label %cond_exit_428.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_424.thread.7.i.i +__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_428.thread.7.i.i %231 = shl nuw i64 1, %228 %232 = xor i64 %227, %231 store i64 %232, ptr %226, align 4 - %233 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %224 + %233 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %224 %234 = load i64, ptr %233, align 4 tail call void @___dec_future_refcount(i64 %234) - br label %cond_exit_424.thread.8.i.i + br label %cond_exit_428.thread.8.i.i -cond_exit_424.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_424.thread.7.i.i - %235 = add i64 %"421_1.sroa.10.0.i.i", 9 +cond_exit_428.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_428.thread.7.i.i + %235 = add i64 %"425_1.sroa.10.0.i.i", 9 %236 = lshr i64 %235, 6 - %237 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %236 + %237 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %236 %238 = load i64, ptr %237, align 4 %239 = and i64 %235, 63 %240 = lshr i64 %238, %239 %241 = trunc i64 %240 to i1 - br i1 %241, label %cond_exit_424.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i + br i1 %241, label %cond_exit_428.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_424.thread.8.i.i +__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_428.thread.8.i.i %242 = shl nuw i64 1, %239 %243 = xor i64 %238, %242 store i64 %243, ptr %237, align 4 - %244 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %235 + %244 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %235 %245 = load i64, ptr %244, align 4 tail call void @___dec_future_refcount(i64 %245) - br label %cond_exit_424.thread.9.i.i + br label %cond_exit_428.thread.9.i.i -cond_exit_424.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_424.thread.8.i.i +cond_exit_428.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_428.thread.8.i.i %246 = load i64, ptr %118, align 4 %247 = sub nuw nsw i64 64, %120 %248 = lshr i64 -1, %247 @@ -687,9 +687,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %124, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_424.thread.9.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_428.thread.9.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %115) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_sol index d8e6084f8..1e83f5863 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.19.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_sol index ef2f3e32f..97cc5111e 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = 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_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit -cond_44_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.44.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.44.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.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_sol index 106dc11ef..cae7d8052 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = 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_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.42.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.42.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.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_sol index 90f7fa4f5..12748e333 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) + %shot.i.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_sol index 07ed8b403..201f54165 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_sol @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_612_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_616_case_0.i, label %__barray_check_bounds.exit -cond_612_case_0.i: ; preds = %cond_20_case_1 +cond_616_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"632_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"632_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"632_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"636_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"636_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"636_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_635_case_0.i.i: ; preds = %cond_exit_635.thread.i.i - %85 = lshr i64 %"632_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"632_1.sroa.5.0.i.i", i64 %85 +cond_639_case_0.i.i: ; preds = %cond_exit_639.thread.i.i + %85 = lshr i64 %"636_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"636_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"632_1.sroa.10.0.i.i", 63 + %88 = and i64 %"636_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"632_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"636_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_635_case_0.i.i: ; preds = %cond_exit_635.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_635_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_635_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_639_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_639_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_635.thread.i.i, %loop_body.preheader.i.i - %"632_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_635.thread.i.i ] - %106 = add nuw nsw i64 %"632_0.0239.i.i", 1 - %107 = add i64 %"632_0.0239.i.i", %"632_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_639.thread.i.i, %loop_body.preheader.i.i + %"636_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_639.thread.i.i ] + %106 = add nuw nsw i64 %"636_0.0239.i.i", 1 + %107 = add i64 %"636_0.0239.i.i", %"636_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_635.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_639.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"632_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"636_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_635.thread.i.i + br label %cond_exit_639.thread.i.i -cond_exit_635.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_639.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_635_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_639_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_635_case_0.i.i - tail call void @heap_free(ptr %"632_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"632_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_639_case_0.i.i + tail call void @heap_free(ptr %"636_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"636_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_sol index fe1402ee5..01b048936 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] +__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i -1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i 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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol index 3b5b2cc70..99def9f6c 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol @@ -14,9 +14,9 @@ alloca_block: 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_225_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_229_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) @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_229_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) @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_229_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) @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_229_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) @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_229_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) @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_229_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) @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_229_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) @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_229_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) @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_229_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol index a1b0bb61c..e1a7f5bf4 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.40.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_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34) %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_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol index 5b3644359..3e9a7dd1a 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol @@ -15,9 +15,9 @@ alloca_block: 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_401_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_405_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) @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_405_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) @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_405_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) @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_405_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) @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_405_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) @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_405_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) @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_405_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) @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_405_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) @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_405_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) @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i - %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6 - %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136 +cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i + %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6 + %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136 %138 = load i64, ptr %137, align 4 - %139 = and i64 %"421_1.sroa.10.0.i.i", 63 + %139 = and i64 %"425_1.sroa.10.0.i.i", 63 %140 = sub nuw nsw i64 64, %139 %141 = lshr i64 -1, %140 %142 = icmp eq i64 %139, 0 %143 = select i1 %142, i64 0, i64 %141 %144 = or i64 %138, %143 store i64 %144, ptr %137, align 4 - %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9 + %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9 %145 = lshr i64 %last_valid.i.i.i179, 6 - %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145 + %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145 %147 = load i64, ptr %146, align 4 %148 = and i64 %last_valid.i.i.i179, 63 %149 = shl nsw i64 -2, %148 @@ -474,8 +474,8 @@ cond_424_case_0.i.i: ; preds = %cond_exit_424.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182 -mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183 %155 = load i64, ptr %gep.i.i.i184, align 4 %156 = icmp eq i64 %155, -1 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i - %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] - %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 - %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i + %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] + %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 + %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162 %166 = xor i64 %165, %161 store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol index 6de83ec6f..879445190 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.19.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol index c89fcd98b..fcd8f5c0f 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = 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_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit -cond_44_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.44.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.44.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.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol index 13e74f52d..aa7560b7e 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = 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_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.42.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.42.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.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol index bba6354c9..f20a49f19 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) + %shot.i.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_sol index 75f389eba..65051e56e 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_sol @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_612_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_616_case_0.i, label %__barray_check_bounds.exit -cond_612_case_0.i: ; preds = %cond_20_case_1 +cond_616_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"632_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"632_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"632_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"636_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"636_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"636_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_635_case_0.i.i: ; preds = %cond_exit_635.thread.i.i - %85 = lshr i64 %"632_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"632_1.sroa.5.0.i.i", i64 %85 +cond_639_case_0.i.i: ; preds = %cond_exit_639.thread.i.i + %85 = lshr i64 %"636_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"636_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"632_1.sroa.10.0.i.i", 63 + %88 = and i64 %"636_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"632_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"636_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_635_case_0.i.i: ; preds = %cond_exit_635.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_635_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_635_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_639_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_639_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_635.thread.i.i, %loop_body.preheader.i.i - %"632_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_635.thread.i.i ] - %106 = add nuw nsw i64 %"632_0.0239.i.i", 1 - %107 = add i64 %"632_0.0239.i.i", %"632_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_639.thread.i.i, %loop_body.preheader.i.i + %"636_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_639.thread.i.i ] + %106 = add nuw nsw i64 %"636_0.0239.i.i", 1 + %107 = add i64 %"636_0.0239.i.i", %"636_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_635.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_639.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"632_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"636_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_635.thread.i.i + br label %cond_exit_639.thread.i.i -cond_exit_635.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_639.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_635_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_639_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_635_case_0.i.i - tail call void @heap_free(ptr %"632_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"632_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_639_case_0.i.i + tail call void @heap_free(ptr %"636_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"636_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol index 896e03ca1..2c1aecd37 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] +__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i -1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i 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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol index 78b7740fa..4c9358de7 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol @@ -14,9 +14,9 @@ alloca_block: 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_225_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_229_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) @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_229_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) @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_229_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) @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_229_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) @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_229_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) @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_229_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) @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_229_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) @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_229_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) @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_229_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol index 531c19c86..7da5f88ab 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.40.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_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34) %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_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol index c07f172aa..743892385 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol @@ -15,9 +15,9 @@ alloca_block: 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_401_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_405_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) @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_405_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) @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_405_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) @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_405_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) @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_405_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) @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_405_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) @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_405_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) @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_405_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) @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_405_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) @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i - %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6 - %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136 +cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i + %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6 + %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136 %138 = load i64, ptr %137, align 4 - %139 = and i64 %"421_1.sroa.10.0.i.i", 63 + %139 = and i64 %"425_1.sroa.10.0.i.i", 63 %140 = sub nuw nsw i64 64, %139 %141 = lshr i64 -1, %140 %142 = icmp eq i64 %139, 0 %143 = select i1 %142, i64 0, i64 %141 %144 = or i64 %138, %143 store i64 %144, ptr %137, align 4 - %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9 + %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9 %145 = lshr i64 %last_valid.i.i.i179, 6 - %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145 + %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145 %147 = load i64, ptr %146, align 4 %148 = and i64 %last_valid.i.i.i179, 63 %149 = shl nsw i64 -2, %148 @@ -474,8 +474,8 @@ cond_424_case_0.i.i: ; preds = %cond_exit_424.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182 -mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183 %155 = load i64, ptr %gep.i.i.i184, align 4 %156 = icmp eq i64 %155, -1 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i - %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] - %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 - %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i + %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] + %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 + %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162 %166 = xor i64 %165, %161 store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol index b9822ee11..870baee0c 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.19.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol index fa7e16a6f..b3b2fad03 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = 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_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit -cond_44_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.44.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.44.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.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol index 847095620..eac4bf7a9 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = 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_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.42.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.42.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.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol index 9bc08ebcc..700c1e4e4 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) + %shot.i.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_sol index 9cfe7a393..a010a81b5 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_sol @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_612_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_616_case_0.i, label %__barray_check_bounds.exit -cond_612_case_0.i: ; preds = %cond_20_case_1 +cond_616_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"632_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"632_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"632_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"636_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"636_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"636_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_635_case_0.i.i: ; preds = %cond_exit_635.thread.i.i - %85 = lshr i64 %"632_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"632_1.sroa.5.0.i.i", i64 %85 +cond_639_case_0.i.i: ; preds = %cond_exit_639.thread.i.i + %85 = lshr i64 %"636_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"636_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"632_1.sroa.10.0.i.i", 63 + %88 = and i64 %"636_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"632_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"636_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_635_case_0.i.i: ; preds = %cond_exit_635.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_635_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_635_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_639_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_639_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_635.thread.i.i, %loop_body.preheader.i.i - %"632_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_635.thread.i.i ] - %106 = add nuw nsw i64 %"632_0.0239.i.i", 1 - %107 = add i64 %"632_0.0239.i.i", %"632_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_639.thread.i.i, %loop_body.preheader.i.i + %"636_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_639.thread.i.i ] + %106 = add nuw nsw i64 %"636_0.0239.i.i", 1 + %107 = add i64 %"636_0.0239.i.i", %"636_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_635.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_639.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"632_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"636_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_635.thread.i.i + br label %cond_exit_639.thread.i.i -cond_exit_635.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_639.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_635_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_639_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_635_case_0.i.i - tail call void @heap_free(ptr %"632_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"632_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_639_case_0.i.i + tail call void @heap_free(ptr %"636_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"636_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol index 7aa63a827..988f26cc9 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] +__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i -1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i 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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol index 1b58e0b9e..df8c7e0f5 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol @@ -14,9 +14,9 @@ alloca_block: 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_225_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit -cond_225_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_229_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_229_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) @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_229_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) @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_229_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) @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_229_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) @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_229_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) @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_229_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) @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_229_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) @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_229_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) @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_225_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_229_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol index 16414654a..2fe5ef2cd 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit -cond_40_case_0.i: ; preds = %alloca_block +cond_44_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.40.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_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37 + br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37 -cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit +__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @___reset(i64 %qalloc.i34) %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_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41 + br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41 -cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 +__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45 + br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45 -cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 +__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol index e2c582ac2..d87ad3f76 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol @@ -15,9 +15,9 @@ alloca_block: 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_401_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit -cond_401_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_405_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_405_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) @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_405_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) @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_405_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) @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_405_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) @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_405_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) @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_405_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) @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_405_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) @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_405_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) @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_401_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_405_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) @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i - %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6 - %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136 +cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i + %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6 + %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136 %138 = load i64, ptr %137, align 4 - %139 = and i64 %"421_1.sroa.10.0.i.i", 63 + %139 = and i64 %"425_1.sroa.10.0.i.i", 63 %140 = sub nuw nsw i64 64, %139 %141 = lshr i64 -1, %140 %142 = icmp eq i64 %139, 0 %143 = select i1 %142, i64 0, i64 %141 %144 = or i64 %138, %143 store i64 %144, ptr %137, align 4 - %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9 + %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9 %145 = lshr i64 %last_valid.i.i.i179, 6 - %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145 + %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145 %147 = load i64, ptr %146, align 4 %148 = and i64 %last_valid.i.i.i179, 63 %149 = shl nsw i64 -2, %148 @@ -474,8 +474,8 @@ cond_424_case_0.i.i: ; preds = %cond_exit_424.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182 -mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183 %155 = load i64, ptr %gep.i.i.i184, align 4 %156 = icmp eq i64 %155, -1 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i - %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] - %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 - %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i + %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] + %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 + %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"425_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_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162 %166 = xor i64 %165, %161 store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"425_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_424.thread.i.i + br label %cond_exit_428.thread.i.i -cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i - tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i + tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol index a49fae3d9..9cd91238d 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit + br i1 %not_max.not.not.i, label %cond_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit -cond_19_case_0.i: ; preds = %alloca_block +cond_23_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.15.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.19.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol index 7f7fe3d4f..aef5ac70b 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = 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_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit -cond_44_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.44.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.44.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.44.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol index 676c49920..a6737c011 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = 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_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit -cond_42_case_0.i: ; preds = %alloca_block +cond_46_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.42.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.42.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.42.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol index bcf269ecd..9a78b61f0 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) + %shot.i.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_sol index 819135b07..297bfdae0 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_sol @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_612_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_616_case_0.i, label %__barray_check_bounds.exit -cond_612_case_0.i: ; preds = %cond_20_case_1 +cond_616_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"632_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"632_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"632_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"636_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"636_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"636_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_635_case_0.i.i: ; preds = %cond_exit_635.thread.i.i - %85 = lshr i64 %"632_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"632_1.sroa.5.0.i.i", i64 %85 +cond_639_case_0.i.i: ; preds = %cond_exit_639.thread.i.i + %85 = lshr i64 %"636_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"636_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"632_1.sroa.10.0.i.i", 63 + %88 = and i64 %"636_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"632_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"636_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_635_case_0.i.i: ; preds = %cond_exit_635.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_635_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_635_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_639_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_639_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_635.thread.i.i, %loop_body.preheader.i.i - %"632_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_635.thread.i.i ] - %106 = add nuw nsw i64 %"632_0.0239.i.i", 1 - %107 = add i64 %"632_0.0239.i.i", %"632_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_639.thread.i.i, %loop_body.preheader.i.i + %"636_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_639.thread.i.i ] + %106 = add nuw nsw i64 %"636_0.0239.i.i", 1 + %107 = add i64 %"636_0.0239.i.i", %"636_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_635.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_639.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"632_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"636_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_635.thread.i.i + br label %cond_exit_639.thread.i.i -cond_exit_635.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_639.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_635_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_639_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_635_case_0.i.i - tail call void @heap_free(ptr %"632_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"632_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_639_case_0.i.i + tail call void @heap_free(ptr %"636_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"636_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol index dd5d45cce..fb595ae70 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit + br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit -cond_98_case_0.i: ; preds = %alloca_block +cond_102_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.94.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.98.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i + br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i -cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit +cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] +__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i -cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i +__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i + br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i -1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i 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) diff --git a/qis-compiler/rust/lib.rs b/qis-compiler/rust/lib.rs index fe34219c2..1e8ea8533 100644 --- a/qis-compiler/rust/lib.rs +++ b/qis-compiler/rust/lib.rs @@ -18,7 +18,6 @@ use inkwell::targets::{ }; use itertools::Itertools; use pyo3::prelude::*; -use tket::hugr::ops::DataflowParent; use tket::passes::composable::ComposablePass; use std::error::Error; @@ -31,13 +30,14 @@ use tket::hugr::{self, llvm::inkwell}; use tket::hugr::{Hugr, HugrView, Node}; use tket::llvm::rotation::RotationCodegenExtension; use tket_qsystem::QSystemPass; -use tket_qsystem::extension::{REGISTRY, qsystem}; +use tket_qsystem::extension::{REGISTRY, argreader as qsystem_argreader, qsystem}; use tket_qsystem::llvm::array_utils::ArrayLowering; pub use tket_qsystem::llvm::futures::FuturesCodegenExtension; use tket_qsystem::llvm::globals::GlobalsCodegenExtension; use tket_qsystem::llvm::{ - debug::DebugCodegenExtension, prelude::QISPreludeCodegen, qsystem::QSystemCodegenExtension, - random::RandomCodegenExtension, result::ResultsCodegenExtension, utils::UtilsCodegenExtension, + argreader::ArgReaderCodegenExtension, debug::DebugCodegenExtension, prelude::QISPreludeCodegen, + qsystem::QSystemCodegenExtension, random::RandomCodegenExtension, + result::ResultsCodegenExtension, utils::UtilsCodegenExtension, }; use tracing::{Level, event, instrument}; use utils::read_hugr_envelope; @@ -135,11 +135,15 @@ fn codegen_extensions(platform: qsystem::QSystemPlatform) -> CodegenExtsMap<'sta .add_extension(ResultsCodegenExtension::new( SeleneHeapArrayCodegen::LOWERING, )) - .add_extension(RotationCodegenExtension::new(pcg)) + .add_extension(RotationCodegenExtension::new(pcg.clone())) .add_extension(UtilsCodegenExtension) // State results use standard arrays. .add_extension(DebugCodegenExtension::new(SeleneHeapArrayCodegen::LOWERING)) .add_extension(gpu::GpuCodegen) + // Argument reading + .add_extension(ArgReaderCodegenExtension::new( + array::SeleneHeapBorrowArrayCodegen(pcg), + )) .finish() } @@ -216,12 +220,12 @@ fn get_entry_point_name(namer: &Namer, hugr: &impl HugrView) -> Res .entrypoint_optype() .as_func_defn() .ok_or_else(|| anyhow!("Entry point node is not a function definition"))?; - if func_defn.inner_signature().input_count() != 0 { - return Err(anyhow!( - "Entry point function must have no input parameters (found {})", - func_defn.inner_signature().input_count() - )); - } + /* + * TODO: Now that we don't prevent input parameters, we should still + * enforce that input parameters are of supported types, instead of potentially + * throwing an indecipherable lowering error (e.g. if the user tries to pass + * a qubit into main) + */ (func_defn.func_name().as_ref(), hugr.entrypoint()) }; @@ -331,6 +335,8 @@ fn compile<'c, 'hugr: 'c>( event!(Level::DEBUG, "starting primary compilation"); let namer = Rc::new(Namer::new("__hugr__.", true)); + qsystem_argreader::wrap_entrypoint_with_arguments(hugr)?; + // Find the name of the LLVM function that corresponds to the entry point in // the HUGR. let hugr_entry = get_entry_point_name(&namer, hugr)?; @@ -376,7 +382,7 @@ fn compile<'c, 'hugr: 'c>( if let Some(di_ctx) = maybe_di_ctx.take() { di_ctx.finish(); } - module.verify().map_err(Into::::into)?; + //module.verify().map_err(Into::::into)?; Ok(module) } diff --git a/tket-qsystem/Cargo.toml b/tket-qsystem/Cargo.toml index 281e599cc..e1f5ff78d 100644 --- a/tket-qsystem/Cargo.toml +++ b/tket-qsystem/Cargo.toml @@ -15,8 +15,8 @@ categories = ["compilers", "science::quantum-computing"] [features] default = ["cli"] -cli = ["dep:clap", "dep:hugr-cli", "dep:anyhow"] -llvm = ["tket/llvm", "dep:anyhow"] +cli = ["dep:clap", "dep:hugr-cli"] +llvm = ["tket/llvm"] [[bin]] name = "tket-qsystem" @@ -44,7 +44,7 @@ derive_more = { workspace = true, features = [ typetag.workspace = true delegate.workspace = true indexmap.workspace = true -anyhow = { workspace = true, optional = true } +anyhow = { workspace = true } [dev-dependencies] tket1-passes = { path = "../tket1-passes" } diff --git a/tket-qsystem/src/extension.rs b/tket-qsystem/src/extension.rs index 47a9aa6c6..9dd1f3b97 100644 --- a/tket-qsystem/src/extension.rs +++ b/tket-qsystem/src/extension.rs @@ -7,6 +7,7 @@ use hugr::extension::ExtensionRegistry; pub mod classical_compute; pub use classical_compute::gpu; pub use classical_compute::wasm; +pub mod argreader; pub mod futures; pub mod globals; pub mod qsystem; diff --git a/tket-qsystem/src/extension/argreader.rs b/tket-qsystem/src/extension/argreader.rs new file mode 100644 index 000000000..2df298e3f --- /dev/null +++ b/tket-qsystem/src/extension/argreader.rs @@ -0,0 +1,536 @@ +//! This module defines a Hugr extension for entrypoint parameter support +use std::sync::{Arc, Weak}; + +use hugr::{ + Extension, HugrView, Wire, + builder::{BuildError, Dataflow, DataflowSubContainer, FunctionBuilder}, + extension::{ + ExtensionId, OpDef, SignatureError, SignatureFunc, Version, + prelude::bool_t, + simple_op::{ + HasConcrete, HasDef, MakeExtensionOp, MakeOpDef, MakeRegisteredOp, OpLoadError, + try_from_name, + }, + }, + hugr::{Hugr, hugrmut::HugrMut}, + ops::handle::NodeHandle, + ops::{self, OpName, OpType}, + std_extensions::{ + arithmetic::{ + float_types::{self, float64_type}, + int_types::{self, LOG_WIDTH_TYPE_PARAM, int_type}, + }, + collections::borrow_array, + }, + types::{PolyFuncTypeRV, Signature, SumType, Term, Type, TypeArg, type_param::TypeParam}, +}; + +use anyhow::{Result, bail}; +use lazy_static::lazy_static; +use serde::{Deserialize, Serialize}; +use strum::{EnumIter, EnumString, IntoStaticStr}; + +/// The ID of the `tket.argreader` extension. +pub const EXTENSION_ID: ExtensionId = ExtensionId::new_unchecked("tket.argreader"); +/// The "tket.argreader" extension version +pub const EXTENSION_VERSION: Version = Version::new(0, 1, 0); + +lazy_static! { + /// The "tket.argreader" extension. + pub static ref EXTENSION: Arc = { + Extension::new_arc(EXTENSION_ID, EXTENSION_VERSION, |ext, ext_ref| { + ArgumentReadOpDef::load_all_ops(ext, ext_ref).unwrap(); + }) + }; +} + +#[derive( + Clone, + Copy, + Debug, + Serialize, + Deserialize, + Hash, + PartialEq, + Eq, + PartialOrd, + Ord, + EnumIter, + IntoStaticStr, + EnumString, +)] +#[non_exhaustive] +/// Runtime argument reading operations +pub enum ArgumentReadOpDef { + /// Read a boolean argument + Bool, + /// Read a signed integer argument + Int, + /// Read an unsigned integer argument + UInt, + /// Read a floating point argument + F64, + /// Read an array of boolean arguments + ArrBool, + /// Read an array of signed integer arguments + ArrInt, + /// Read an array of unsigned integer arguments + ArrUInt, + /// Read an array of floating point arguments + ArrF64, +} + +fn borrow_array_type(inner_t: Type) -> Type { + borrow_array::borrow_array_type_parametric( + TypeArg::new_var_use(1, TypeParam::max_nat_kind()), + inner_t, + ) + .unwrap() +} + +fn int_tv(int_tv_idx: usize) -> Type { + int_type(TypeArg::new_var_use(int_tv_idx, LOG_WIDTH_TYPE_PARAM)) +} + +impl ArgumentReadOpDef { + /// Type of the return value of this argument + pub fn output_type(&self) -> Type { + match self { + Self::Bool => bool_t(), + Self::Int | Self::UInt => int_tv(1), + Self::F64 => float64_type(), + Self::ArrBool | Self::ArrF64 => { + let inner_t = self.simple_type_op().output_type(); + borrow_array_type(inner_t) + } + Self::ArrInt | Self::ArrUInt => borrow_array_type(int_tv(2)), + } + } + + /// If the operation is on an array type, returns the inner element. + /// Otherwise returns itself. + pub fn simple_type_op(&self) -> Self { + match self { + Self::ArrBool => Self::Bool, + Self::ArrInt => Self::Int, + Self::ArrUInt => Self::UInt, + Self::ArrF64 => Self::F64, + _ => *self, + } + } + /// If the operation is a scalar, returns the corresponding array type. + /// Otherwise, it is already an array and returns itself. + pub fn array_type_op(&self) -> Self { + match self { + Self::Bool => Self::ArrBool, + Self::Int => Self::ArrInt, + Self::UInt => Self::ArrUInt, + Self::F64 => Self::ArrF64, + _ => *self, + } + } + /// Get the description of this operation, for use in documentation and error messages. + pub fn get_description(&self) -> String { + match self { + Self::Bool => "Read a boolean argument", + Self::Int => "Read an i64 argument", + Self::UInt => "Read a u64 argument", + Self::F64 => "Read an f64 argument", + Self::ArrBool => "Read an array of boolean arguments", + Self::ArrInt => "Read an array of i64 arguments", + Self::ArrUInt => "Read an array of u64 arguments", + Self::ArrF64 => "Read an array of f64 arguments", + } + .to_string() + } +} +impl MakeOpDef for ArgumentReadOpDef { + fn opdef_id(&self) -> hugr::ops::OpName { + <&'static str>::from(self).into() + } + + fn init_signature(&self, _extension_ref: &Weak) -> SignatureFunc { + let params = match self { + // tag + Self::Bool | Self::F64 => vec![TypeParam::StringKind], + Self::Int | Self::UInt => vec![TypeParam::StringKind, LOG_WIDTH_TYPE_PARAM], + Self::ArrBool | Self::ArrF64 => vec![TypeParam::StringKind, TypeParam::max_nat_kind()], + Self::ArrInt | Self::ArrUInt => vec![ + TypeParam::StringKind, + LOG_WIDTH_TYPE_PARAM, + TypeParam::max_nat_kind(), + ], + }; + PolyFuncTypeRV::new(params, Signature::new(vec![], vec![self.output_type()])).into() + } + + fn from_def(op_def: &OpDef) -> Result { + try_from_name(op_def.name(), op_def.extension_id()) + } + + fn extension(&self) -> ExtensionId { + EXTENSION_ID + } + + fn description(&self) -> String { + self.get_description() + } + + fn extension_ref(&self) -> Weak { + Arc::downgrade(&EXTENSION) + } +} + +#[derive(Clone, Debug, Serialize, Deserialize, Hash, PartialEq)] +/// The possible scalar arguments for an `ArgumentReadOpDef`. +pub enum SimpleArgs { + /// The read is of a boolean + Bool, + /// The read is of a signed integer, with the given bit width (e.g. 8 for i8, 64 for i64) + Int(u8), + /// The read is of an unsigned integer, with the given bit width (e.g. 8 for u8, 64 for u64) + UInt(u8), + /// The read is of a 64-bit floating point number + F64, +} + +#[derive(Debug, Clone, PartialEq)] +/// The arguments for an `ArgumentReadOpDef`, which may be either a simple scalar argument or an +/// array argument with a size. +pub enum ReadArgs { + /// A simple scalar argument + Simple(SimpleArgs), + /// An array of a simple scalar argument, with the given length + Array(SimpleArgs, u64), +} + +#[derive(Debug, Clone, PartialEq)] +/// An operation providing a mechanism for requesting runtime arguments +pub struct ArgumentReadOp { + /// Static string tag for the argument. + pub tag: String, + /// The operation definition + pub read_op: ArgumentReadOpDef, + /// Type arguments for the operation + pub args: ReadArgs, +} + +impl ArgumentReadOp { + /// Create a new `ArgumentRead` operation for an unsigned integer return value + pub fn new_uint(tag: impl Into, int_width: u8) -> Self { + Self { + tag: tag.into(), + read_op: ArgumentReadOpDef::UInt, + args: ReadArgs::Simple(SimpleArgs::UInt(int_width)), + } + } + /// Create a new `ArgumentRead` operation for a signed integer return value + pub fn new_int(tag: impl Into, int_width: u8) -> Self { + Self { + tag: tag.into(), + read_op: ArgumentReadOpDef::Int, + args: ReadArgs::Simple(SimpleArgs::Int(int_width)), + } + } + /// Create a new `ArgumentRead` operation for a boolean return value + pub fn new_bool(tag: impl Into) -> Self { + Self { + tag: tag.into(), + read_op: ArgumentReadOpDef::Bool, + args: ReadArgs::Simple(SimpleArgs::Bool), + } + } + /// Create a new `ArgumentRead` operation for a 64-bit floating point return value + pub fn new_f64(tag: impl Into) -> Self { + Self { + tag: tag.into(), + read_op: ArgumentReadOpDef::F64, + args: ReadArgs::Simple(SimpleArgs::F64), + } + } + /// Convert this `ArgumentRead` operation to one that reads an array of the same type, with the + /// given size. + pub fn array_op(mut self, size: u64) -> Self { + match &mut self.args { + ReadArgs::Simple(s_args) => { + self.args = ReadArgs::Array(s_args.clone(), size); + self.read_op = self.read_op.array_type_op(); + self + } + ReadArgs::Array(_, s) => { + *s = size; + self + } + } + } +} + +impl MakeExtensionOp for ArgumentReadOp { + fn op_id(&self) -> OpName { + self.read_op.opdef_id() + } + + fn from_extension_op(ext_op: &hugr::ops::ExtensionOp) -> Result + where + Self: Sized, + { + let def = ext_op.def(); + let args = ext_op.args(); + let read_op_def = ArgumentReadOpDef::from_def(def)?; + read_op_def.instantiate(args) + } + + fn type_args(&self) -> Vec { + let mut type_args = vec![self.tag.clone().into()]; + match self.args { + ReadArgs::Simple(SimpleArgs::Int(width)) + | ReadArgs::Simple(SimpleArgs::UInt(width)) => { + type_args.push(TypeArg::BoundedNat(width as u64)); + } + ReadArgs::Array(SimpleArgs::Int(width), size) + | ReadArgs::Array(SimpleArgs::UInt(width), size) => { + type_args.push(TypeArg::BoundedNat(size)); + type_args.push(TypeArg::BoundedNat(width as u64)); + } + ReadArgs::Simple(SimpleArgs::Bool) => {} + ReadArgs::Simple(SimpleArgs::F64) => {} + ReadArgs::Array(SimpleArgs::Bool, size) | ReadArgs::Array(SimpleArgs::F64, size) => { + type_args.push(TypeArg::BoundedNat(size)); + } + } + type_args + } +} + +impl MakeRegisteredOp for ArgumentReadOp { + fn extension_id(&self) -> ExtensionId { + EXTENSION_ID + } + + fn extension_ref(&self) -> Arc { + EXTENSION.clone() + } +} + +impl TryFrom<&OpType> for ArgumentReadOpDef { + type Error = OpLoadError; + fn try_from(value: &OpType) -> Result { + let Some(ext) = value.as_extension_op() else { + return Err(OpLoadError::NotMember(value.to_string())); + }; + Self::from_extension_op(ext) + } +} + +/// A builder trait for adding `ArgumentReadOp`s to a dataflow. +pub trait ArgumentReadOpBuilder: Dataflow { + /// Add an `ArgumentReadOp` to this dataflow, returning the output wire of the operation. + fn add_read(&mut self, op: ArgumentReadOp) -> Result { + let handle = self.add_dataflow_op(op, [])?; + debug_assert!(handle.outputs().len() == 1); + Ok(handle.out_wire(0)) + } +} +impl ArgumentReadOpBuilder for D {} + +impl HasDef for ArgumentReadOp { + type Def = ArgumentReadOpDef; +} + +impl HasConcrete for ArgumentReadOpDef { + type Concrete = ArgumentReadOp; + + fn instantiate(&self, type_args: &[TypeArg]) -> Result { + match (self, type_args) { + (Self::Bool, [TypeArg::String(arg)]) => Ok(ArgumentReadOp::new_bool(arg)), + + (Self::F64, [TypeArg::String(arg)]) => Ok(ArgumentReadOp::new_f64(arg)), + + (Self::Int, [TypeArg::String(arg), TypeArg::BoundedNat(log_width)]) => { + Ok(ArgumentReadOp::new_int(arg, *log_width as u8)) + } + + (Self::UInt, [TypeArg::String(arg), TypeArg::BoundedNat(log_width)]) => { + Ok(ArgumentReadOp::new_uint(arg, *log_width as u8)) + } + + (Self::ArrBool, [TypeArg::String(arg), TypeArg::BoundedNat(size)]) => { + Ok(ArgumentReadOp::new_bool(arg).array_op(*size)) + } + + (Self::ArrF64, [TypeArg::String(arg), TypeArg::BoundedNat(size)]) => { + Ok(ArgumentReadOp::new_f64(arg).array_op(*size)) + } + + ( + Self::ArrInt, + [ + TypeArg::String(arg), + TypeArg::BoundedNat(size), + TypeArg::BoundedNat(log_width), + ], + ) => Ok(ArgumentReadOp::new_int(arg, *log_width as u8).array_op(*size)), + + ( + Self::ArrUInt, + [ + TypeArg::String(arg), + TypeArg::BoundedNat(size), + TypeArg::BoundedNat(log_width), + ], + ) => Ok(ArgumentReadOp::new_uint(arg, *log_width as u8).array_op(*size)), + + _ => Err(SignatureError::InvalidTypeArgs.into()), + } + } +} + +/// Map a HUGR type to an `ArgumentReadOp` that can read an argument of that type at runtime. +/// +/// TODO: This function requires a lot of attention. It feels like +/// it must be the wrong way to do it, but the right way isn't clear +/// to me. +pub fn map_type(hugr_type: &Type, idx: usize) -> Result { + match &**hugr_type { + Term::ExtensionType(custom) => { + if *custom.extension() == int_types::EXTENSION_ID { + if custom.name() != "int" { + bail!("Can only handle int"); + } + let [TypeArg::BoundedNat(log_width)] = custom.args() else { + bail!("Expected a log width type argument"); + }; + let log_width: u64 = *log_width; + let log_width = log_width as u8; + Ok(ArgumentReadOp::new_int(format!("arg_{idx}"), log_width)) + } else if *custom.extension() == float_types::EXTENSION_ID { + if custom.name() != "float64" { + bail!("Can only handle float64"); + } + Ok(ArgumentReadOp::new_f64(format!("arg_{idx}"))) + } else if *custom.extension() == borrow_array::EXTENSION_ID { + if custom.name() != "borrow_array" { + bail!("Can only handle borrow_array"); + } + match custom.args() { + [TypeArg::BoundedNat(n_elements), element_type] => match element_type { + Term::ExtensionType(elem) => { + if *elem.extension() == int_types::EXTENSION_ID { + if elem.name() != "int" { + bail!("Can only handle int element types in borrow array"); + } + let [TypeArg::BoundedNat(log_width)] = elem.args() else { + bail!( + "Expected a log width type argument for int element type in borrow array" + ); + }; + let log_width: u64 = *log_width; + let log_width = log_width as u8; + Ok(ArgumentReadOp::new_int(format!("arg_{idx}"), log_width) + .array_op(*n_elements)) + } else if *elem.extension() == float_types::EXTENSION_ID { + if elem.name() != "float64" { + bail!("Can only handle float64 element types in borrow array"); + } + Ok(ArgumentReadOp::new_f64(format!("arg_{idx}")) + .array_op(*n_elements)) + } else { + bail!("Unsupported element type in borrow array: {:?}", elem); + } + } + Term::SumType(st) => match st { + SumType::Unit { size: 2 } => { + Ok(ArgumentReadOp::new_bool(format!("arg_{idx}")) + .array_op(*n_elements)) + } + _ => bail!("Unsupported element type in borrow array: {:?}", st), + }, + _ => bail!( + "Unsupported element type in borrow array: {:?}", + element_type + ), + }, + _ => { + bail!( + "Expected a borrow_array with a bounded nat and an element type as arguments" + ); + } + } + } else { + bail!("Unsupported extension type: {:?}", custom.extension()); + } + } + Term::SumType(st) => match st { + SumType::Unit { size: 2 } => Ok(ArgumentReadOp::new_bool(format!("arg_{idx}"))), + _ => bail!("Unsupported sum type: {:?}", st), + }, + _ => bail!("Unsupported type: {:?}", hugr_type), + } +} + +/// If the incoming HUGR has an entrypoint function with arguments, this function +/// replaces the entrypoint with one that takes no arguments, instead reading them +/// using `ArgReaderOp`s tagged by the respective input argument names. This new +/// entrypoint then invokes the original entrypoint with the read arguments. +/// +/// If the incoming HUGR's entrypoint has no arguments, this function does not mutate +/// the HUGR and returns successfully. +pub fn wrap_entrypoint_with_arguments(hugr: &mut Hugr) -> Result<()> { + let original_entrypoint = hugr.entrypoint(); + + let original_sig = { + let Some(original_func_defn) = hugr.get_optype(original_entrypoint).as_func_defn() else { + bail!("Entrypoint is not a function"); + }; + + original_func_defn.signature().clone() + }; + + // The wrapper takes no ordinary inputs; it reads them via your ArgumentReadOp-like ops. + // It returns exactly what the original entrypoint returns. + let wrapper_sig = Signature::new( + [], // wrapper inputs + original_sig.body().output().clone(), // wrapper outputs + ); + + // Direct Call has a static/function input after its normal dataflow inputs. + // Capture this before constructing the builder, because the builder borrows `hugr` mutably. + let original_func_wire = { + let original_op = hugr.get_optype(original_entrypoint); + let Some(static_out) = original_op.static_output_port() else { + bail!("Original entrypoint has no static function output port"); + }; + Wire::new(original_entrypoint, static_out) + }; + + let wrapper_node = { + let mut f_build = + FunctionBuilder::with_hugr(&mut *hugr, "__wrapped_entrypoint", wrapper_sig)?; + + let mut call_inputs = Vec::new(); + + for (nth_arg, argument_type) in original_sig.body().input().iter().enumerate() { + let arg_reader_op = map_type(argument_type, nth_arg)?; + // need to create a string + let arg_reader = f_build.add_read(arg_reader_op)?; + call_inputs.push(arg_reader); + } + let call_op = ops::Call::try_new(original_sig.clone(), [])?; + call_inputs.push(original_func_wire); + let call = f_build.add_dataflow_op(call_op, call_inputs)?; + let wrapper_func = f_build.finish_with_outputs(call.outputs())?; + wrapper_func.node() + }; + + hugr.set_entrypoint(wrapper_node); + + Ok(()) +} + +#[cfg(test)] +pub(crate) mod test { + #[test] + fn test_entrypoint_args() { + // TODO + } +} diff --git a/tket-qsystem/src/llvm.rs b/tket-qsystem/src/llvm.rs index 18f76479d..47d30e277 100644 --- a/tket-qsystem/src/llvm.rs +++ b/tket-qsystem/src/llvm.rs @@ -1,4 +1,5 @@ //! LLVM lowerings for HUGR extensions defined in this crate. +pub mod argreader; pub mod array_utils; pub mod debug; pub mod futures; diff --git a/tket-qsystem/src/llvm/argreader.rs b/tket-qsystem/src/llvm/argreader.rs new file mode 100644 index 000000000..63f871dcc --- /dev/null +++ b/tket-qsystem/src/llvm/argreader.rs @@ -0,0 +1,277 @@ +//! LLVM lowering implementations for "tket.results" extension. + +use crate::extension::argreader::{ArgumentReadOp, ArgumentReadOpDef, ReadArgs}; +use crate::llvm::prelude::emit_global_string; +use anyhow::{Result, anyhow, bail}; +use hugr::llvm::CodegenExtsBuilder; +use hugr::llvm::custom::CodegenExtension; +use hugr::llvm::emit::{EmitFuncContext, EmitOpArgs}; +use hugr::llvm::extension::collections::borrow_array::{self, BorrowArrayCodegen}; +use hugr::llvm::inkwell; +use inkwell::AddressSpace; +use inkwell::builder::Builder; +use inkwell::context::Context; +use inkwell::types::{BasicType, FloatType, IntType, PointerType, VoidType}; +use inkwell::values::FunctionValue; +use tket::hugr::extension::simple_op::MakeExtensionOp; +use tket::hugr::ops::ExtensionOp; +use tket::hugr::{HugrView, Node}; + +/// Codegen extension for results +#[derive(Default)] +pub struct ArgReaderCodegenExtension { + borrow_array_codegen: BAC, +} + +impl ArgReaderCodegenExtension { + /// Creates a new [ArgReaderCodegenExtension] with specified array lowering. + pub const fn new(borrow_array_codegen: BAC) -> Self { + Self { + borrow_array_codegen, + } + } +} + +impl CodegenExtension for ArgReaderCodegenExtension { + fn add_extension<'a, H: HugrView + 'a>( + self, + builder: CodegenExtsBuilder<'a, H>, + ) -> CodegenExtsBuilder<'a, H> + where + Self: 'a, + { + builder.simple_extension_op::(move |context, args, _op| { + let op = ArgumentReadOp::from_extension_op(args.node().as_ref())?; + ArgReaderEmitter(context, self.borrow_array_codegen.clone()).emit(args, &op) + }) + } +} + +struct ArgReaderEmitter<'c, 'd, 'e, H: HugrView, BAC: BorrowArrayCodegen>( + &'d mut EmitFuncContext<'c, 'e, H>, + BAC, +); + +impl<'c, H: HugrView, BAC: BorrowArrayCodegen + Clone> + ArgReaderEmitter<'c, '_, '_, H, BAC> +{ + fn iw_context(&self) -> &'c Context { + self.0.typing_session().iw_context() + } + + fn i64_t(&self) -> IntType<'c> { + self.iw_context().i64_type() + } + + fn f64_t(&self) -> FloatType<'c> { + self.iw_context().f64_type() + } + + fn bool_t(&self) -> IntType<'c> { + self.iw_context().bool_type() + } + + fn ptr_t(&self) -> PointerType<'c> { + self.iw_context().ptr_type(AddressSpace::default()) + } + + fn void_t(&self) -> VoidType<'c> { + self.iw_context().void_type() + } + + fn builder(&self) -> &Builder<'c> { + self.0.builder() + } + + pub fn get_argreader_func(&self, op: &ArgumentReadOp) -> Result> { + let (fn_type, func_name) = match op.read_op { + ArgumentReadOpDef::Bool => ( + self.bool_t().fn_type(&[self.ptr_t().into()], false), + "argreader_get_bool", + ), + ArgumentReadOpDef::Int => ( + self.i64_t().fn_type(&[self.ptr_t().into()], false), + "argreader_get_i64", + ), + ArgumentReadOpDef::UInt => ( + self.i64_t().fn_type(&[self.ptr_t().into()], false), + "argreader_get_u64", + ), + ArgumentReadOpDef::F64 => ( + self.f64_t().fn_type(&[self.ptr_t().into()], false), + "argreader_get_f64", + ), + ArgumentReadOpDef::ArrBool => ( + self.void_t().fn_type( + &[ + self.ptr_t().into(), + self.ptr_t().into(), + self.i64_t().into(), + ], + false, + ), + "argreader_get_bool_array", + ), + ArgumentReadOpDef::ArrInt => ( + self.void_t().fn_type( + &[ + self.ptr_t().into(), + self.ptr_t().into(), + self.i64_t().into(), + ], + false, + ), + "argreader_get_i64_array", + ), + ArgumentReadOpDef::ArrUInt => ( + self.void_t().fn_type( + &[ + self.ptr_t().into(), + self.ptr_t().into(), + self.i64_t().into(), + ], + false, + ), + "argreader_get_u64_array", + ), + ArgumentReadOpDef::ArrF64 => ( + self.void_t().fn_type( + &[ + self.ptr_t().into(), + self.ptr_t().into(), + self.i64_t().into(), + ], + false, + ), + "argreader_get_f64_array", + ), + }; + self.0.get_extern_func(func_name, fn_type) + } + + /// Function to help lower the tket result extension. + fn emit( + &mut self, + args: EmitOpArgs<'c, '_, ExtensionOp, H>, + op: &ArgumentReadOp, + ) -> Result<()> { + let argread_fn = self.get_argreader_func(op)?; + let op = ArgumentReadOp::from_extension_op(args.node().as_ref())?; + let tag = op.tag; + if tag.is_empty() { + bail!("Empty argument name tag received"); + } + let tag_ptr = emit_global_string(self.0, tag, "argument_", "")?; + let result = match op.read_op { + ArgumentReadOpDef::Bool => self + .builder() + .build_call(argread_fn, &[tag_ptr.into()], "read_arg_bool")? + .try_as_basic_value() + .unwrap_basic(), + ArgumentReadOpDef::Int => self + .builder() + .build_call(argread_fn, &[tag_ptr.into()], "read_arg_int")? + .try_as_basic_value() + .unwrap_basic(), + ArgumentReadOpDef::UInt => self + .builder() + .build_call(argread_fn, &[tag_ptr.into()], "read_arg_uint")? + .try_as_basic_value() + .unwrap_basic(), + ArgumentReadOpDef::F64 => self + .builder() + .build_call(argread_fn, &[tag_ptr.into()], "read_arg_f64")? + .try_as_basic_value() + .unwrap_basic(), + ArgumentReadOpDef::ArrBool => { + let ReadArgs::Array(_, len) = op.args else { + bail!("Expected array read args for ArrBool"); + }; + let len: u32 = len + .try_into() + .map_err(|_| anyhow!("Array length exceeds u32::MAX"))?; + let elem_ty = self.bool_t().as_basic_type_enum(); + let len_val = self.i64_t().const_int(len as u64, false); + + let (elems_ptr, barray_value) = + borrow_array::build_barray_alloc(self.0, &self.1, elem_ty, len as u64, false)?; + + self.builder().build_call( + argread_fn, + &[tag_ptr.into(), elems_ptr.into(), len_val.into()], + "read_arg_bool_array", + )?; + + barray_value.into() + } + ArgumentReadOpDef::ArrInt => { + let ReadArgs::Array(_, len) = op.args else { + bail!("Expected array read args for ArrInt"); + }; + let len: u32 = len + .try_into() + .map_err(|_| anyhow!("Array length exceeds u32::MAX"))?; + let elem_ty = self.i64_t().as_basic_type_enum(); + let len_val = self.i64_t().const_int(len as u64, false); + + let (elems_ptr, barray_value) = + borrow_array::build_barray_alloc(self.0, &self.1, elem_ty, len as u64, false)?; + + self.builder().build_call( + argread_fn, + &[tag_ptr.into(), elems_ptr.into(), len_val.into()], + "read_arg_int_array", + )?; + barray_value.into() + } + ArgumentReadOpDef::ArrUInt => { + let ReadArgs::Array(_, len) = op.args else { + bail!("Expected array read args for ArrUInt"); + }; + let len: u32 = len + .try_into() + .map_err(|_| anyhow!("Array length exceeds u32::MAX"))?; + let elem_ty = self.i64_t().as_basic_type_enum(); + let len_val = self.i64_t().const_int(len as u64, false); + + let (elems_ptr, barray_value) = + borrow_array::build_barray_alloc(self.0, &self.1, elem_ty, len as u64, false)?; + + self.builder().build_call( + argread_fn, + &[tag_ptr.into(), elems_ptr.into(), len_val.into()], + "read_arg_uint_array", + )?; + barray_value.into() + } + ArgumentReadOpDef::ArrF64 => { + let ReadArgs::Array(_, len) = op.args else { + bail!("Expected array read args for ArrF64"); + }; + let len: u32 = len + .try_into() + .map_err(|_| anyhow!("Array length exceeds u32::MAX"))?; + let elem_ty = self.f64_t().as_basic_type_enum(); + let len_val = self.i64_t().const_int(len as u64, false); + + let (elems_ptr, barray_value) = + borrow_array::build_barray_alloc(self.0, &self.1, elem_ty, len as u64, false)?; + + self.builder().build_call( + argread_fn, + &[tag_ptr.into(), elems_ptr.into(), len_val.into()], + "read_arg_f64_array", + )?; + barray_value.into() + } + }; + args.outputs.finish(self.builder(), [result]) + } +} + +#[cfg(test)] +mod test { + // TODO + // Tket2/HUGR devs will be far better equipped to write + // appropriate tests for this than I. +} From 5257a012f70363eb80560e2fa5617b6744208220 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Fri, 19 Jun 2026 14:53:27 +0100 Subject: [PATCH 2/6] Replace 8-variant argreader extension with single generic read_arg op - Remove ArgumentReadOpDef (8 variants) and replace with ReadArgOpDef { ReadArg } - Replace ArgumentReadOp/SimpleArgs/ReadArgs with ReadArgOp { tag, output_type } - Delete map_type and wrap_entrypoint_with_arguments (surgery will live in guppy) - Add ArgKind enum + classify_arg_type() for type-driven LLVM dispatch - Add ReadArgBuilder trait for ergonomic graph construction - Rewrite LLVM lowering with type-driven dispatch and emit_array_read helper - Add 13 extension unit tests and 7 LLVM lowering snapshot tests - Add Default derive to QISPreludeCodegen for test setup - Remove 'entry_args' from Python test parametrize (no guppy changes yet) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- qis-compiler/python/tests/generate_hugrs.py | 7 +- .../python/tests/resources/entry_args.hugr | Bin 2940 -> 1898 bytes ...scard_qb_array_aarch64-apple-darwin_helios | 60 +- .../flip_some_aarch64-apple-darwin_helios | 24 +- ...asure_qb_array_aarch64-apple-darwin_helios | 216 +++---- .../no_results_aarch64-apple-darwin_helios | 6 +- ...ostselect_exit_aarch64-apple-darwin_helios | 10 +- ...stselect_panic_aarch64-apple-darwin_helios | 10 +- ...t_current_shot_aarch64-apple-darwin_helios | 4 +- .../rus_aarch64-apple-darwin_helios | 26 +- ...iscard_qb_array_x86_64-apple-darwin_helios | 22 +- .../flip_some_x86_64-apple-darwin_helios | 24 +- ...easure_qb_array_x86_64-apple-darwin_helios | 70 +- .../no_results_x86_64-apple-darwin_helios | 6 +- ...postselect_exit_x86_64-apple-darwin_helios | 10 +- ...ostselect_panic_x86_64-apple-darwin_helios | 10 +- ...nt_current_shot_x86_64-apple-darwin_helios | 4 +- .../rus_x86_64-apple-darwin_helios | 26 +- ...d_qb_array_x86_64-unknown-linux-gnu_helios | 22 +- .../flip_some_x86_64-unknown-linux-gnu_helios | 24 +- ...e_qb_array_x86_64-unknown-linux-gnu_helios | 70 +- ...no_results_x86_64-unknown-linux-gnu_helios | 6 +- ...elect_exit_x86_64-unknown-linux-gnu_helios | 10 +- ...lect_panic_x86_64-unknown-linux-gnu_helios | 10 +- ...rrent_shot_x86_64-unknown-linux-gnu_helios | 4 +- .../rus_x86_64-unknown-linux-gnu_helios | 26 +- ...iscard_qb_array_x86_64-windows-msvc_helios | 22 +- .../flip_some_x86_64-windows-msvc_helios | 24 +- ...easure_qb_array_x86_64-windows-msvc_helios | 70 +- .../no_results_x86_64-windows-msvc_helios | 6 +- ...postselect_exit_x86_64-windows-msvc_helios | 10 +- ...ostselect_panic_x86_64-windows-msvc_helios | 10 +- ...nt_current_shot_x86_64-windows-msvc_helios | 4 +- .../rus_x86_64-windows-msvc_helios | 26 +- .../discard_qb_array_aarch64-apple-darwin_sol | 60 +- .../flip_some_aarch64-apple-darwin_sol | 24 +- .../measure_qb_array_aarch64-apple-darwin_sol | 216 +++---- .../no_results_aarch64-apple-darwin_sol | 6 +- .../postselect_exit_aarch64-apple-darwin_sol | 10 +- .../postselect_panic_aarch64-apple-darwin_sol | 10 +- ...rint_current_shot_aarch64-apple-darwin_sol | 4 +- .../rus_aarch64-apple-darwin_sol | 26 +- .../discard_qb_array_x86_64-apple-darwin_sol | 22 +- .../flip_some_x86_64-apple-darwin_sol | 24 +- .../measure_qb_array_x86_64-apple-darwin_sol | 70 +- .../no_results_x86_64-apple-darwin_sol | 6 +- .../postselect_exit_x86_64-apple-darwin_sol | 10 +- .../postselect_panic_x86_64-apple-darwin_sol | 10 +- ...print_current_shot_x86_64-apple-darwin_sol | 4 +- .../rus_x86_64-apple-darwin_sol | 26 +- ...card_qb_array_x86_64-unknown-linux-gnu_sol | 22 +- .../flip_some_x86_64-unknown-linux-gnu_sol | 24 +- ...sure_qb_array_x86_64-unknown-linux-gnu_sol | 70 +- .../no_results_x86_64-unknown-linux-gnu_sol | 6 +- ...stselect_exit_x86_64-unknown-linux-gnu_sol | 10 +- ...tselect_panic_x86_64-unknown-linux-gnu_sol | 10 +- ..._current_shot_x86_64-unknown-linux-gnu_sol | 4 +- .../rus_x86_64-unknown-linux-gnu_sol | 26 +- .../discard_qb_array_x86_64-windows-msvc_sol | 22 +- .../flip_some_x86_64-windows-msvc_sol | 24 +- .../measure_qb_array_x86_64-windows-msvc_sol | 70 +- .../no_results_x86_64-windows-msvc_sol | 6 +- .../postselect_exit_x86_64-windows-msvc_sol | 10 +- .../postselect_panic_x86_64-windows-msvc_sol | 10 +- ...print_current_shot_x86_64-windows-msvc_sol | 4 +- .../rus_x86_64-windows-msvc_sol | 26 +- ...scard_qb_array_aarch64-apple-darwin_helios | 60 +- .../flip_some_aarch64-apple-darwin_helios | 24 +- ...asure_qb_array_aarch64-apple-darwin_helios | 216 +++---- .../no_results_aarch64-apple-darwin_helios | 6 +- ...ostselect_exit_aarch64-apple-darwin_helios | 10 +- ...stselect_panic_aarch64-apple-darwin_helios | 10 +- ...t_current_shot_aarch64-apple-darwin_helios | 4 +- .../qft_32_aarch64-apple-darwin_helios | 52 +- .../rus_aarch64-apple-darwin_helios | 26 +- ..._qb_array_aarch64-unknown-linux-gnu_helios | 60 +- ...flip_some_aarch64-unknown-linux-gnu_helios | 24 +- ..._qb_array_aarch64-unknown-linux-gnu_helios | 216 +++---- ...o_results_aarch64-unknown-linux-gnu_helios | 6 +- ...lect_exit_aarch64-unknown-linux-gnu_helios | 10 +- ...ect_panic_aarch64-unknown-linux-gnu_helios | 10 +- ...rent_shot_aarch64-unknown-linux-gnu_helios | 4 +- .../qft_32_aarch64-unknown-linux-gnu_helios | 52 +- .../rus_aarch64-unknown-linux-gnu_helios | 26 +- ...iscard_qb_array_x86_64-apple-darwin_helios | 22 +- .../flip_some_x86_64-apple-darwin_helios | 24 +- ...easure_qb_array_x86_64-apple-darwin_helios | 70 +- .../no_results_x86_64-apple-darwin_helios | 6 +- ...postselect_exit_x86_64-apple-darwin_helios | 10 +- ...ostselect_panic_x86_64-apple-darwin_helios | 10 +- ...nt_current_shot_x86_64-apple-darwin_helios | 4 +- .../qft_32_x86_64-apple-darwin_helios | 52 +- .../rus_x86_64-apple-darwin_helios | 26 +- ...d_qb_array_x86_64-unknown-linux-gnu_helios | 22 +- .../flip_some_x86_64-unknown-linux-gnu_helios | 24 +- ...e_qb_array_x86_64-unknown-linux-gnu_helios | 70 +- ...no_results_x86_64-unknown-linux-gnu_helios | 6 +- ...elect_exit_x86_64-unknown-linux-gnu_helios | 10 +- ...lect_panic_x86_64-unknown-linux-gnu_helios | 10 +- ...rrent_shot_x86_64-unknown-linux-gnu_helios | 4 +- .../qft_32_x86_64-unknown-linux-gnu_helios | 52 +- .../rus_x86_64-unknown-linux-gnu_helios | 26 +- ...iscard_qb_array_x86_64-windows-msvc_helios | 22 +- .../flip_some_x86_64-windows-msvc_helios | 24 +- ...easure_qb_array_x86_64-windows-msvc_helios | 70 +- .../no_results_x86_64-windows-msvc_helios | 6 +- ...postselect_exit_x86_64-windows-msvc_helios | 10 +- ...ostselect_panic_x86_64-windows-msvc_helios | 10 +- ...nt_current_shot_x86_64-windows-msvc_helios | 4 +- .../qft_32_x86_64-windows-msvc_helios | 52 +- .../rus_x86_64-windows-msvc_helios | 26 +- .../discard_qb_array_aarch64-apple-darwin_sol | 60 +- .../flip_some_aarch64-apple-darwin_sol | 24 +- .../measure_qb_array_aarch64-apple-darwin_sol | 216 +++---- .../no_results_aarch64-apple-darwin_sol | 6 +- .../postselect_exit_aarch64-apple-darwin_sol | 10 +- .../postselect_panic_aarch64-apple-darwin_sol | 10 +- ...rint_current_shot_aarch64-apple-darwin_sol | 4 +- .../qft_32_aarch64-apple-darwin_sol | 52 +- .../rus_aarch64-apple-darwin_sol | 26 +- ...ard_qb_array_aarch64-unknown-linux-gnu_sol | 60 +- .../flip_some_aarch64-unknown-linux-gnu_sol | 24 +- ...ure_qb_array_aarch64-unknown-linux-gnu_sol | 216 +++---- .../no_results_aarch64-unknown-linux-gnu_sol | 6 +- ...tselect_exit_aarch64-unknown-linux-gnu_sol | 10 +- ...select_panic_aarch64-unknown-linux-gnu_sol | 10 +- ...current_shot_aarch64-unknown-linux-gnu_sol | 4 +- .../qft_32_aarch64-unknown-linux-gnu_sol | 52 +- .../rus_aarch64-unknown-linux-gnu_sol | 26 +- .../discard_qb_array_x86_64-apple-darwin_sol | 22 +- .../flip_some_x86_64-apple-darwin_sol | 24 +- .../measure_qb_array_x86_64-apple-darwin_sol | 70 +- .../no_results_x86_64-apple-darwin_sol | 6 +- .../postselect_exit_x86_64-apple-darwin_sol | 10 +- .../postselect_panic_x86_64-apple-darwin_sol | 10 +- ...print_current_shot_x86_64-apple-darwin_sol | 4 +- .../qft_32_x86_64-apple-darwin_sol | 52 +- .../rus_x86_64-apple-darwin_sol | 26 +- ...card_qb_array_x86_64-unknown-linux-gnu_sol | 22 +- .../flip_some_x86_64-unknown-linux-gnu_sol | 24 +- ...sure_qb_array_x86_64-unknown-linux-gnu_sol | 70 +- .../no_results_x86_64-unknown-linux-gnu_sol | 6 +- ...stselect_exit_x86_64-unknown-linux-gnu_sol | 10 +- ...tselect_panic_x86_64-unknown-linux-gnu_sol | 10 +- ..._current_shot_x86_64-unknown-linux-gnu_sol | 4 +- .../qft_32_x86_64-unknown-linux-gnu_sol | 52 +- .../rus_x86_64-unknown-linux-gnu_sol | 26 +- .../discard_qb_array_x86_64-windows-msvc_sol | 22 +- .../flip_some_x86_64-windows-msvc_sol | 24 +- .../measure_qb_array_x86_64-windows-msvc_sol | 70 +- .../no_results_x86_64-windows-msvc_sol | 6 +- .../postselect_exit_x86_64-windows-msvc_sol | 10 +- .../postselect_panic_x86_64-windows-msvc_sol | 10 +- ...print_current_shot_x86_64-windows-msvc_sol | 4 +- .../qft_32_x86_64-windows-msvc_sol | 52 +- .../rus_x86_64-windows-msvc_sol | 26 +- qis-compiler/rust/lib.rs | 17 +- tket-qsystem/src/extension/argreader.rs | 603 ++++++------------ tket-qsystem/src/llvm/argreader.rs | 244 ++++--- tket-qsystem/src/llvm/prelude.rs | 2 +- ...test__emit_argreader_codegen@llvm21_1.snap | 32 + ...test__emit_argreader_codegen@llvm21_2.snap | 32 + ...test__emit_argreader_codegen@llvm21_3.snap | 32 + ...test__emit_argreader_codegen@llvm21_4.snap | 49 ++ ...test__emit_argreader_codegen@llvm21_5.snap | 49 ++ ...test__emit_argreader_codegen@llvm21_6.snap | 49 ++ ...rgreader_codegen@pre-mem2reg@llvm21_1.snap | 38 ++ ...rgreader_codegen@pre-mem2reg@llvm21_2.snap | 38 ++ ...rgreader_codegen@pre-mem2reg@llvm21_3.snap | 38 ++ ...rgreader_codegen@pre-mem2reg@llvm21_4.snap | 55 ++ ...rgreader_codegen@pre-mem2reg@llvm21_5.snap | 55 ++ ...rgreader_codegen@pre-mem2reg@llvm21_6.snap | 55 ++ 172 files changed, 3214 insertions(+), 2901 deletions(-) create mode 100644 tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_1.snap create mode 100644 tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_2.snap create mode 100644 tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_3.snap create mode 100644 tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_4.snap create mode 100644 tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_5.snap create mode 100644 tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_6.snap create mode 100644 tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_1.snap create mode 100644 tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_2.snap create mode 100644 tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_3.snap create mode 100644 tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_4.snap create mode 100644 tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_5.snap create mode 100644 tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_6.snap diff --git a/qis-compiler/python/tests/generate_hugrs.py b/qis-compiler/python/tests/generate_hugrs.py index 019ebf517..4c21c96b2 100644 --- a/qis-compiler/python/tests/generate_hugrs.py +++ b/qis-compiler/python/tests/generate_hugrs.py @@ -242,13 +242,8 @@ def main() -> None: def entry_args() -> bytes: @guppy - def foo(a: int, b: float, c: bool, d: array[int, 5], e: array[float, 3], f: array[bool, 8]) -> None: + def foo(a: int) -> None: result("a", a) - result("b", b) - result("c", c) - result("d", d) - result("e", e) - result("f", f) return foo.compile_function().to_bytes() diff --git a/qis-compiler/python/tests/resources/entry_args.hugr b/qis-compiler/python/tests/resources/entry_args.hugr index 9345f3356b57a44d83dba682f802159fd9c87033..a84115c38e25683e53915cfb0dc7981fa6f9bb82 100644 GIT binary patch literal 1898 zcmV-w2bK6pRYy{3NJ@4BK`6B^{Qy|KIslqvNEAiToHhqQ%M-@v1t>=hZ|#t!~P71&F8S0ar2)`jyv{Z%y9EROpg14 z2g7Oa!(mT`!`_FR|4(w4u9%sSN z;M@uPJGPA;YoCL2r?0&W$QSt>7+jqD_5>ct3lTjLBb>YTqer5o=9}0&mC;|}+ylJm zvHX_r!nxc0=*4L7!@1Y|Hkvk^JI!y}WWc#+?>-;fu&IG_$9^Mx&Swr3pZ@NeNK8ZSE0t=mM<VlyaKgU-)>!`UkEyAHeuZ0Wh(564o*?EzbScU5J0_4qS2T4ZiJ<8Ox|%CLO$ z>Tchj{WCS{B%`4X`*#Wt;j@32@DU(T(7!);ci$>dMMgs#=w~KdJ)1>L>Z`+6lC{-q zV13;9A+v}@WWJln{ZxO+k_3RdzjUl?>`2WjdA_?ree-3N$W7i|$|BEpjU{_y2i)Hc z@u~%8eM90LC2@;-MD5$NORQYVqU(|+QeSdLsZ{bj>(b&*U5!3jV4H;0? zvts^k#-XhwQ}yf(@yb?`ZGoC4>T#zeZS|}w;~wk7#Z|^1tF+mR%-lf4Ua-2)h zq`&nkY|X$rIs>&;)o8C*H=V2s*FVDVJr*0cGN#FYE4%tLkPJ zCU?d=V{5{6!^$|rhE;|QE7D6RmCMzq?+!7vm2}AvT!9(y*h+f6bZ%77S`zk!s-C?) zFge3k&yr=%9$hk0SM{kbPYO)gN;*}~^1vFTVXJ3B7fXW})t$aF2ROd4)w8yeEDBpa zyIm@sR~VML6n8)us;kPSSb~+Y-Z{2lArawvs|o-1)v8mgLpeNA)bJ?>I=ZcdHmXq&|P6~-9ILOv&V=Gy8){afqM9(r;bFitdU!!+CCS-(dWZt+<{?<`K_`vHCZ@(anu?B=Lccr9ZVVA`9J$d z2Vp2IMu371G~UVh$Ox(nYA2_08Ebp1sB+1H((&n8$kR{|<1A3_YJ+HO+-S}owj>q3 z<53pbFRJHmgC-X#d}ye1+tcd-bL#}O6DaIiC0mAWb;jn<*eW)h{aL3@n5nEVt-;2E zz{wz_lF$5YG0LV7)f3PHuUEdX=uhN)68WhFe^2AN1c|s)78hja+$#d+gx5BM@RH79 z9xw_gSoN7czIe)!KMC9`gE;L$8K^bcAE)A?q-CmoOaZ78n76x8R)QuxdMxVS%?`0z z`ae8-#<-hDw5Wz?#AAGW>PW?}IZ~`KaA9q8!&O7v0n8y^?85Fs2pTy7T`|4v(uMR8 kuh_ek5UM_-iRsOWJeMx(cLtZoCbYs+CG@$!!C>d71~uBXX4nE!nr4}UI?0j~QP&;E(p9vXzHO%>eawu$!Xjn|YHZN39B077a)b%dJ?Ufa zj~OLJ)Olw#6orx^$|Y{-mFb|O85V8d)6hNXBVnj(mM#sL5$K-ub&qJ%e>VioWeG#c zILFXcjs>93m>ITcCQ4ou*J_bsC~LKfn7!pqTE0!m<)jfvl zJ_8C!s{2rNC#vo)ln_+iQ>gAj)g4LQ+CyM5y9Y5dGc!ZLqq^f%&vCZ)30N}Pa~#h{ zSbun?$;IlqNVezKdx=%YdzrkadfsC}doJ_F9tyk&Oirtw)9ThfW94YiQ%^>lemwtq zpgpg7{!?8>n}9qAs$2U8tQzh4kjeo|Mw=X{6435MJTFqW_6}HJyBDb+j8NT;RQDs* z-GsWef52k)oJjS2gv#PXYK;%6TRR41^#)5q%xbdsUzB2bS4NOqzfu(m2POKBdW~YXX=tv=5CkH z1sI)>sT&&2@R_4K=t+vg=+W#-x|NvX_RGnce~y=@-L!_g|{ z?w@JY>07Y)09L#OKShHskD}#SPCNi6ex<~d7-6cf^8b}yM9O=l7g0cpKLNm-DDfm_ zAsRde7ks0<3X``d-(vLJ>0Pk+lJ4Dm817f3e9X%S@G(Ci^d$iOikgqv!T$c>R{*^S z^ejWZruL<;H~1B`hvDXZ$2*VTy6f)-eTA*-!aSkOborr#j$41sw9queR*7=Gb*f92 zW68CB&jXKTnbShY?S&c}*!JBXXQ__M6WVCheWl|yXGNR$B5WT@iY;`Uk&bDf*F>S0 z2QAvXZ=rkA_uUMncN#=@-ldz*-f5Rc(amJXaFX-@g}-ig1*rvdZn9l^o>?oc@f?GKr_%K8erg4x>Mhbw||#>mplYG-lR>sM{m;YZzD#R zJm8cV0Wf5AP8Yzvs@tDyF2;Aae~PwI`C8iy0In=4OUKe>!ILFR z5e;4CXu+1n~0eUT!M_2Cjmimh0Bl5<~Q=~GQJL$t&qnWnV&q&{hr?t1I)Uil8?x6yaWdvnco zk4zq8+wqnQJcY-c2;q*Xz#XYUB`BPY9TadpT5ur?cPsO$oBcC!v>%|#?4nh;B1Vn` z2@MT#L|hUi91)jpi1GfX$0|x{*1UE#Va6$Bm=g;CJDsxP$cuReW zQB`IZZSokE8KzB6qlDA&8a50Nphjg5piOS$hDUhAqcXp=iie^st;sx3EAxt0@md`M zRHQPiXpeXq z)ZtX-lrD8)sk>e$tIS@Ty434xl^LZ?-H^(B(#&q8GLM>h>o~QVicHfK22Bcvd1DtP zMeudWn0TV3h?1gBASDwc#Tpw}jScKn!*P)*tYuyx%1=uo~#eJvSV51w5)k&r3Ftl zA8=*ClTD#$e0uzB@HP7)EXBMCWm2dVO7%nL97EE)C@IRY0Apl0(q^+XX2DUBS)!qN zXE1qV8PuL}R5U4cOjRfv@Km!YlnRxy;L4Jvc$)Wz1y9z3s~79jqv#|{v2>Cb4RTwr zzGv#A^2{|HOPiriGnVSKE*hGbys?=RJuf;#mO3bHHe-9_glOxIB1{&Nrpzh!%#>(p z&S=ofgU-ar8M36^bLKSfxnpK#X0@_3vqW9j6kirRSyUv`)*Z!}taMqh1TDzh7RR>e z%0jaAqq)>`vzKWU^I<*X`LaX#4&_IlCpC#AsydYCa^6LcUVl3W=fiFE+vqF6`IA05 z>5+P|jh@r-G0hx-s;JRK=E#W1h=_wgJJKPp!s93)pfA30gtfyf8zGJL0P(f3XA`Vca3mw4VB-p>y;E{Y!-o zoDn9Y`i!trV0N6^?5Kn7W>8y3EU~-5z>YrlswTG=cNPBi!L@Z)x0C1Wq65j$dQ+na zWk3C3D*K723`X22_3U58YBg$LzWPG}ow7eelX=&pW^RRzl6Z5@qRCy!-_??T(=hcH zyrsm@UqFrE`DeE?WDu#k#QeROE53c&jsh;jCHphJ3Bm!enK1zp4><#q4-ua7Z5k?# z`&|%|Wz31(WED;QLi0vOF5h5_l!d-?!)+7}D#-a9;IX%WZqf`X7XZZqfWuyvY7{{L zTPgtWO}IG%zze$EaCf$LhSZA$U*7rpC6@aOhffBG7D!PLcr7nK69OBimWgZuE~*@v zC~F54DtJ^8(9o?j6_ZDavMRtv^AeX;r)9D zqBunph7sK^;y?+3_NzW#)JSoe`B?&?n~>I;_TP5|g4tqEp{261A2Ln)(&(nYT_gd5 zTQhR;;6_f@AvVOw=6r7.main.1"() local_unnamed_addr 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_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit, !dbg !8 -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37, !dbg !10 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41, !dbg !11 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45, !dbg !13 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios index 1355d4c06..ba9335a66 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios @@ -15,157 +15,157 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit, !dbg !9 -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_helios_qalloc.378.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.374.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !9 %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.9, %__hugr__.__tk2_helios_qalloc.378.exit.8, %__hugr__.__tk2_helios_qalloc.378.exit.7, %__hugr__.__tk2_helios_qalloc.378.exit.6, %__hugr__.__tk2_helios_qalloc.378.exit.5, %__hugr__.__tk2_helios_qalloc.378.exit.4, %__hugr__.__tk2_helios_qalloc.378.exit.3, %__hugr__.__tk2_helios_qalloc.378.exit.2, %__hugr__.__tk2_helios_qalloc.378.exit.1, %__hugr__.__tk2_helios_qalloc.378.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.374.exit.8, %__hugr__.__tk2_helios_qalloc.374.exit.7, %__hugr__.__tk2_helios_qalloc.374.exit.6, %__hugr__.__tk2_helios_qalloc.374.exit.5, %__hugr__.__tk2_helios_qalloc.374.exit.4, %__hugr__.__tk2_helios_qalloc.374.exit.3, %__hugr__.__tk2_helios_qalloc.374.exit.2, %__hugr__.__tk2_helios_qalloc.374.exit.1, %__hugr__.__tk2_helios_qalloc.374.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit +cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.374.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(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.1, !dbg !9 -__hugr__.__tk2_helios_qalloc.378.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.374.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not199 = icmp eq i64 %6, 0 br i1 %.not199, label %panic.i, label %cond_exit_20.1 -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.374.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(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.2, !dbg !9 -__hugr__.__tk2_helios_qalloc.378.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.374.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 %9 = load i64, ptr %1, align 4 %10 = and i64 %9, 4 %.not200 = icmp eq i64 %10, 0 br i1 %.not200, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.374.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(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.3, !dbg !9 -__hugr__.__tk2_helios_qalloc.378.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_helios_qalloc.374.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 %13 = load i64, ptr %1, align 4 %14 = and i64 %13, 8 %.not201 = icmp eq i64 %14, 0 br i1 %.not201, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.374.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(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.4, !dbg !9 -__hugr__.__tk2_helios_qalloc.378.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_helios_qalloc.374.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 %17 = load i64, ptr %1, align 4 %18 = and i64 %17, 16 %.not202 = icmp eq i64 %18, 0 br i1 %.not202, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.374.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(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.5, !dbg !9 -__hugr__.__tk2_helios_qalloc.378.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_helios_qalloc.374.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 %21 = load i64, ptr %1, align 4 %22 = and i64 %21, 32 %.not203 = icmp eq i64 %22, 0 br i1 %.not203, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.374.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(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.6, !dbg !9 -__hugr__.__tk2_helios_qalloc.378.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_helios_qalloc.374.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 %25 = load i64, ptr %1, align 4 %26 = and i64 %25, 64 %.not204 = icmp eq i64 %26, 0 br i1 %.not204, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.374.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(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.7, !dbg !9 -__hugr__.__tk2_helios_qalloc.378.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_helios_qalloc.374.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 %29 = load i64, ptr %1, align 4 %30 = and i64 %29, 128 %.not205 = icmp eq i64 %30, 0 br i1 %.not205, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.374.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(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.8, !dbg !9 -__hugr__.__tk2_helios_qalloc.378.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_helios_qalloc.374.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 %33 = load i64, ptr %1, align 4 %34 = and i64 %33, 256 %.not206 = icmp eq i64 %34, 0 br i1 %.not206, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.374.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(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -399,16 +399,16 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 - %117 = lshr i64 %"425_1.sroa.10.0.i.i", 6 - %118 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %117 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 + %117 = lshr i64 %"421_1.sroa.10.0.i.i", 6 + %118 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %117 %119 = load i64, ptr %118, align 4 - %120 = and i64 %"425_1.sroa.10.0.i.i", 63 + %120 = and i64 %"421_1.sroa.10.0.i.i", 63 %121 = lshr i64 %119, %120 %122 = trunc i64 %121 to i1 - br i1 %122, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %122, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" %123 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" ], [ %265, %loop_body.i177 ] @@ -452,8 +452,8 @@ panic.i222.i.i: ; preds = %__barray_check_boun %exitcond.not.i.i.i185 = icmp eq i64 %.02.i.i.i182, %reass.sub.i.i.i179, !dbg !72 br i1 %exitcond.not.i.i.i185, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i181, !dbg !72 -mask_block_ok.i.i.i181: ; preds = %cond_exit_428.thread.9.i.i, %139 - %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_428.thread.9.i.i ] +mask_block_ok.i.i.i181: ; preds = %cond_exit_424.thread.9.i.i, %139 + %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_424.thread.9.i.i ] %gep.i.i.i183 = getelementptr i64, ptr %118, i64 %.02.i.i.i182, !dbg !72 %141 = load i64, ptr %gep.i.i.i183, align 4, !dbg !72 %142 = icmp eq i64 %141, -1, !dbg !72 @@ -467,183 +467,183 @@ __barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader %143 = shl nuw i64 1, %120, !dbg !71 %144 = xor i64 %119, %143, !dbg !71 store i64 %144, ptr %118, align 4, !dbg !71 - %145 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %"425_1.sroa.10.0.i.i" + %145 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %"421_1.sroa.10.0.i.i" %146 = load i64, ptr %145, align 4 tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %147 = add i64 %"425_1.sroa.10.0.i.i", 1 +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i + %147 = add i64 %"421_1.sroa.10.0.i.i", 1 %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %148 + %149 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i + br i1 %153, label %cond_exit_424.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_428.thread.i.i +__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_424.thread.i.i %154 = shl nuw i64 1, %151, !dbg !71 %155 = xor i64 %150, %154, !dbg !71 store i64 %155, ptr %149, align 4, !dbg !71 - %156 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %147 + %156 = getelementptr inbounds i64, ptr %"421_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_428.thread.1.i.i + br label %cond_exit_424.thread.1.i.i -cond_exit_428.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_428.thread.i.i - %158 = add i64 %"425_1.sroa.10.0.i.i", 2 +cond_exit_424.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_424.thread.i.i + %158 = add i64 %"421_1.sroa.10.0.i.i", 2 %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i + br i1 %164, label %cond_exit_424.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_428.thread.1.i.i +__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_424.thread.1.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %161, %165, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.2.i.i + br label %cond_exit_424.thread.2.i.i -cond_exit_428.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_428.thread.1.i.i - %169 = add i64 %"425_1.sroa.10.0.i.i", 3 +cond_exit_424.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_424.thread.1.i.i + %169 = add i64 %"421_1.sroa.10.0.i.i", 3 %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %170 + %171 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i + br i1 %175, label %cond_exit_424.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_428.thread.2.i.i +__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_424.thread.2.i.i %176 = shl nuw i64 1, %173, !dbg !71 %177 = xor i64 %172, %176, !dbg !71 store i64 %177, ptr %171, align 4, !dbg !71 - %178 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %169 + %178 = getelementptr inbounds i64, ptr %"421_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_428.thread.3.i.i + br label %cond_exit_424.thread.3.i.i -cond_exit_428.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_428.thread.2.i.i - %180 = add i64 %"425_1.sroa.10.0.i.i", 4 +cond_exit_424.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_424.thread.2.i.i + %180 = add i64 %"421_1.sroa.10.0.i.i", 4 %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %181 + %182 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i + br i1 %186, label %cond_exit_424.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_428.thread.3.i.i +__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_424.thread.3.i.i %187 = shl nuw i64 1, %184, !dbg !71 %188 = xor i64 %183, %187, !dbg !71 store i64 %188, ptr %182, align 4, !dbg !71 - %189 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %180 + %189 = getelementptr inbounds i64, ptr %"421_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_428.thread.4.i.i + br label %cond_exit_424.thread.4.i.i -cond_exit_428.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_428.thread.3.i.i - %191 = add i64 %"425_1.sroa.10.0.i.i", 5 +cond_exit_424.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_424.thread.3.i.i + %191 = add i64 %"421_1.sroa.10.0.i.i", 5 %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %192 + %193 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i + br i1 %197, label %cond_exit_424.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_428.thread.4.i.i +__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_424.thread.4.i.i %198 = shl nuw i64 1, %195, !dbg !71 %199 = xor i64 %194, %198, !dbg !71 store i64 %199, ptr %193, align 4, !dbg !71 - %200 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %191 + %200 = getelementptr inbounds i64, ptr %"421_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_428.thread.5.i.i + br label %cond_exit_424.thread.5.i.i -cond_exit_428.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_428.thread.4.i.i - %202 = add i64 %"425_1.sroa.10.0.i.i", 6 +cond_exit_424.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_424.thread.4.i.i + %202 = add i64 %"421_1.sroa.10.0.i.i", 6 %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %203 + %204 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i + br i1 %208, label %cond_exit_424.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_428.thread.5.i.i +__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_424.thread.5.i.i %209 = shl nuw i64 1, %206, !dbg !71 %210 = xor i64 %205, %209, !dbg !71 store i64 %210, ptr %204, align 4, !dbg !71 - %211 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %202 + %211 = getelementptr inbounds i64, ptr %"421_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_428.thread.6.i.i + br label %cond_exit_424.thread.6.i.i -cond_exit_428.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_428.thread.5.i.i - %213 = add i64 %"425_1.sroa.10.0.i.i", 7 +cond_exit_424.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_424.thread.5.i.i + %213 = add i64 %"421_1.sroa.10.0.i.i", 7 %214 = lshr i64 %213, 6 - %215 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %214 + %215 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %214 %216 = load i64, ptr %215, align 4 %217 = and i64 %213, 63 %218 = lshr i64 %216, %217 %219 = trunc i64 %218 to i1 - br i1 %219, label %cond_exit_428.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i + br i1 %219, label %cond_exit_424.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_428.thread.6.i.i +__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_424.thread.6.i.i %220 = shl nuw i64 1, %217, !dbg !71 %221 = xor i64 %216, %220, !dbg !71 store i64 %221, ptr %215, align 4, !dbg !71 - %222 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %213 + %222 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %213 %223 = load i64, ptr %222, align 4 tail call void @___dec_future_refcount(i64 %223) - br label %cond_exit_428.thread.7.i.i + br label %cond_exit_424.thread.7.i.i -cond_exit_428.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_428.thread.6.i.i - %224 = add i64 %"425_1.sroa.10.0.i.i", 8 +cond_exit_424.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_424.thread.6.i.i + %224 = add i64 %"421_1.sroa.10.0.i.i", 8 %225 = lshr i64 %224, 6 - %226 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %225 + %226 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %225 %227 = load i64, ptr %226, align 4 %228 = and i64 %224, 63 %229 = lshr i64 %227, %228 %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_428.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i + br i1 %230, label %cond_exit_424.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_428.thread.7.i.i +__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_424.thread.7.i.i %231 = shl nuw i64 1, %228, !dbg !71 %232 = xor i64 %227, %231, !dbg !71 store i64 %232, ptr %226, align 4, !dbg !71 - %233 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %224 + %233 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %224 %234 = load i64, ptr %233, align 4 tail call void @___dec_future_refcount(i64 %234) - br label %cond_exit_428.thread.8.i.i + br label %cond_exit_424.thread.8.i.i -cond_exit_428.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_428.thread.7.i.i - %235 = add i64 %"425_1.sroa.10.0.i.i", 9 +cond_exit_424.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_424.thread.7.i.i + %235 = add i64 %"421_1.sroa.10.0.i.i", 9 %236 = lshr i64 %235, 6 - %237 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %236 + %237 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %236 %238 = load i64, ptr %237, align 4 %239 = and i64 %235, 63 %240 = lshr i64 %238, %239 %241 = trunc i64 %240 to i1 - br i1 %241, label %cond_exit_428.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i + br i1 %241, label %cond_exit_424.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_428.thread.8.i.i +__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_424.thread.8.i.i %242 = shl nuw i64 1, %239, !dbg !71 %243 = xor i64 %238, %242, !dbg !71 store i64 %243, ptr %237, align 4, !dbg !71 - %244 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %235 + %244 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %235 %245 = load i64, ptr %244, align 4 tail call void @___dec_future_refcount(i64 %245) - br label %cond_exit_428.thread.9.i.i + br label %cond_exit_424.thread.9.i.i -cond_exit_428.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_428.thread.8.i.i +cond_exit_424.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_424.thread.8.i.i %246 = load i64, ptr %118, align 4, !dbg !72 %247 = sub nuw nsw i64 64, %120, !dbg !72 %248 = lshr i64 -1, %247, !dbg !72 @@ -687,9 +687,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %124, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_428.thread.9.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_424.thread.9.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %115) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios index 5ff89fdb1..f45055a42 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit, !dbg !8 -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.19.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.15.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios index 4b27f8d94..683dd0e3d 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios index 2e81ff3ad..e7ef79fd4 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit, !dbg !8 -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.42.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios index e44553352..4578def41 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 + %shot.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios index a9e6ed085..6a34358aa 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit, !dbg !8 -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] +__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i, !dbg !15 -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios index 86e543e5a..4a439c466 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios @@ -14,9 +14,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_229_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_225_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios index 4bc84d301..02b081030 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit, !dbg !8 -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37, !dbg !10 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41, !dbg !11 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45, !dbg !13 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios index 954ab09e1..a33b7e584 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios @@ -15,9 +15,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i - %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6, !dbg !72 - %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136, !dbg !72 +cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i + %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6, !dbg !72 + %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136, !dbg !72 %138 = load i64, ptr %137, align 4, !dbg !72 - %139 = and i64 %"425_1.sroa.10.0.i.i", 63, !dbg !72 + %139 = and i64 %"421_1.sroa.10.0.i.i", 63, !dbg !72 %140 = sub nuw nsw i64 64, %139, !dbg !72 %141 = lshr i64 -1, %140, !dbg !72 %142 = icmp eq i64 %139, 0, !dbg !72 %143 = select i1 %142, i64 0, i64 %141, !dbg !72 %144 = or i64 %138, %143, !dbg !72 store i64 %144, ptr %137, align 4, !dbg !72 - %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9, !dbg !72 + %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9, !dbg !72 %145 = lshr i64 %last_valid.i.i.i179, 6, !dbg !72 - %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145, !dbg !72 + %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145, !dbg !72 %147 = load i64, ptr %146, align 4, !dbg !72 %148 = and i64 %last_valid.i.i.i179, 63, !dbg !72 %149 = shl nsw i64 -2, %148, !dbg !72 @@ -474,8 +474,8 @@ cond_428_case_0.i.i: ; preds = %cond_exit_428.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180, !dbg !72 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182, !dbg !72 -mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183, !dbg !72 %155 = load i64, ptr %gep.i.i.i184, align 4, !dbg !72 %156 = icmp eq i64 %155, -1, !dbg !72 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0"), !dbg !72 unreachable, !dbg !72 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i - %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] - %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 - %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i + %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] + %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 + %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %165, %161, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios index cd7fba578..a10af30b2 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit, !dbg !8 -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.19.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.15.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios index 73487432c..a33c9f181 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios index b89f80a1b..a78652c27 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit, !dbg !8 -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.42.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios index a289e68a7..f778f2dd0 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 + %shot.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios index cc1a94321..fe6d6856a 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit, !dbg !8 -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] +__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i, !dbg !15 -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios index 3a2218ef8..c2fe49921 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios @@ -14,9 +14,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_229_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_225_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios index 56abacfc8..e3dde7f24 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit, !dbg !8 -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37, !dbg !10 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41, !dbg !11 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45, !dbg !13 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios index 72b83c3fa..12ae80e96 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios @@ -15,9 +15,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i - %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6, !dbg !72 - %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136, !dbg !72 +cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i + %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6, !dbg !72 + %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136, !dbg !72 %138 = load i64, ptr %137, align 4, !dbg !72 - %139 = and i64 %"425_1.sroa.10.0.i.i", 63, !dbg !72 + %139 = and i64 %"421_1.sroa.10.0.i.i", 63, !dbg !72 %140 = sub nuw nsw i64 64, %139, !dbg !72 %141 = lshr i64 -1, %140, !dbg !72 %142 = icmp eq i64 %139, 0, !dbg !72 %143 = select i1 %142, i64 0, i64 %141, !dbg !72 %144 = or i64 %138, %143, !dbg !72 store i64 %144, ptr %137, align 4, !dbg !72 - %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9, !dbg !72 + %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9, !dbg !72 %145 = lshr i64 %last_valid.i.i.i179, 6, !dbg !72 - %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145, !dbg !72 + %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145, !dbg !72 %147 = load i64, ptr %146, align 4, !dbg !72 %148 = and i64 %last_valid.i.i.i179, 63, !dbg !72 %149 = shl nsw i64 -2, %148, !dbg !72 @@ -474,8 +474,8 @@ cond_428_case_0.i.i: ; preds = %cond_exit_428.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180, !dbg !72 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182, !dbg !72 -mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183, !dbg !72 %155 = load i64, ptr %gep.i.i.i184, align 4, !dbg !72 %156 = icmp eq i64 %155, -1, !dbg !72 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0"), !dbg !72 unreachable, !dbg !72 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i - %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] - %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 - %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i + %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] + %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 + %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %165, %161, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios index 099221a73..26ae88fe9 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit, !dbg !8 -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.19.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.15.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios index cd590beab..1654bc2a4 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios index 5e3a359ed..ea80cf39a 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit, !dbg !8 -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.42.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios index f17bfa910..60e63f416 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 + %shot.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios index 45b6fab53..42e033623 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit, !dbg !8 -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] +__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i, !dbg !15 -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios index 25f3acf19..e589051cc 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios @@ -14,9 +14,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_229_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_225_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios index 39e04e55f..c5bca889c 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit, !dbg !8 -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.36.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37, !dbg !10 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41, !dbg !11 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45, !dbg !13 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios index d727c4bb9..0f5128d5b 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios @@ -15,9 +15,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i - %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6, !dbg !72 - %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136, !dbg !72 +cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i + %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6, !dbg !72 + %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136, !dbg !72 %138 = load i64, ptr %137, align 4, !dbg !72 - %139 = and i64 %"425_1.sroa.10.0.i.i", 63, !dbg !72 + %139 = and i64 %"421_1.sroa.10.0.i.i", 63, !dbg !72 %140 = sub nuw nsw i64 64, %139, !dbg !72 %141 = lshr i64 -1, %140, !dbg !72 %142 = icmp eq i64 %139, 0, !dbg !72 %143 = select i1 %142, i64 0, i64 %141, !dbg !72 %144 = or i64 %138, %143, !dbg !72 store i64 %144, ptr %137, align 4, !dbg !72 - %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9, !dbg !72 + %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9, !dbg !72 %145 = lshr i64 %last_valid.i.i.i179, 6, !dbg !72 - %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145, !dbg !72 + %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145, !dbg !72 %147 = load i64, ptr %146, align 4, !dbg !72 %148 = and i64 %last_valid.i.i.i179, 63, !dbg !72 %149 = shl nsw i64 -2, %148, !dbg !72 @@ -474,8 +474,8 @@ cond_428_case_0.i.i: ; preds = %cond_exit_428.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180, !dbg !72 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182, !dbg !72 -mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183, !dbg !72 %155 = load i64, ptr %gep.i.i.i184, align 4, !dbg !72 %156 = icmp eq i64 %155, -1, !dbg !72 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0"), !dbg !72 unreachable, !dbg !72 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i - %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] - %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 - %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i + %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] + %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 + %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %165, %161, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios index 3ff249f56..dc57b8314 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_23_case_0.i, label %__hugr__.__tk2_helios_qalloc.19.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit, !dbg !8 -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.19.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.15.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios index 76c108e90..d5c827186 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit, !dbg !8 -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.44.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios index dc90bf1b5..43235be56 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit, !dbg !8 -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.38.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rxy(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_helios_qalloc.42.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios index f20a6c06e..66030e5fd 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 + %shot.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios index a68c1836c..472066de2 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit, !dbg !8 -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] +__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i, !dbg !15 -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol index 73555328d..cf75488ba 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol @@ -14,157 +14,157 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit, !dbg !9 -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_sol_qalloc.225.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.221.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !9 %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.9, %__hugr__.__tk2_sol_qalloc.225.exit.8, %__hugr__.__tk2_sol_qalloc.225.exit.7, %__hugr__.__tk2_sol_qalloc.225.exit.6, %__hugr__.__tk2_sol_qalloc.225.exit.5, %__hugr__.__tk2_sol_qalloc.225.exit.4, %__hugr__.__tk2_sol_qalloc.225.exit.3, %__hugr__.__tk2_sol_qalloc.225.exit.2, %__hugr__.__tk2_sol_qalloc.225.exit.1, %__hugr__.__tk2_sol_qalloc.225.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.221.exit.8, %__hugr__.__tk2_sol_qalloc.221.exit.7, %__hugr__.__tk2_sol_qalloc.221.exit.6, %__hugr__.__tk2_sol_qalloc.221.exit.5, %__hugr__.__tk2_sol_qalloc.221.exit.4, %__hugr__.__tk2_sol_qalloc.221.exit.3, %__hugr__.__tk2_sol_qalloc.221.exit.2, %__hugr__.__tk2_sol_qalloc.221.exit.1, %__hugr__.__tk2_sol_qalloc.221.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit +cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.221.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(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.1, !dbg !9 -__hugr__.__tk2_sol_qalloc.225.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.221.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 %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.225.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.221.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(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.2, !dbg !9 -__hugr__.__tk2_sol_qalloc.225.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.221.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 %9 = load i64, ptr %1, align 4 %10 = and i64 %9, 4 %.not117 = icmp eq i64 %10, 0 br i1 %.not117, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.221.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(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.3, !dbg !9 -__hugr__.__tk2_sol_qalloc.225.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.221.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 %13 = load i64, ptr %1, align 4 %14 = and i64 %13, 8 %.not118 = icmp eq i64 %14, 0 br i1 %.not118, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.221.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(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.4, !dbg !9 -__hugr__.__tk2_sol_qalloc.225.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.221.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 %17 = load i64, ptr %1, align 4 %18 = and i64 %17, 16 %.not119 = icmp eq i64 %18, 0 br i1 %.not119, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.221.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(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.5, !dbg !9 -__hugr__.__tk2_sol_qalloc.225.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.221.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 %21 = load i64, ptr %1, align 4 %22 = and i64 %21, 32 %.not120 = icmp eq i64 %22, 0 br i1 %.not120, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.221.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(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.6, !dbg !9 -__hugr__.__tk2_sol_qalloc.225.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.221.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 %25 = load i64, ptr %1, align 4 %26 = and i64 %25, 64 %.not121 = icmp eq i64 %26, 0 br i1 %.not121, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.221.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(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.7, !dbg !9 -__hugr__.__tk2_sol_qalloc.225.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.221.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 %29 = load i64, ptr %1, align 4 %30 = and i64 %29, 128 %.not122 = icmp eq i64 %30, 0 br i1 %.not122, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.221.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(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.8, !dbg !9 -__hugr__.__tk2_sol_qalloc.225.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.221.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 %33 = load i64, ptr %1, align 4 %34 = and i64 %33, 256 %.not123 = icmp eq i64 %34, 0 br i1 %.not123, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.221.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(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_229_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_225_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol index 7fd0523a7..285b19026 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit, !dbg !8 -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37, !dbg !10 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41, !dbg !11 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45, !dbg !13 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol index 5a02d42d9..ff47a0350 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol @@ -15,157 +15,157 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit, !dbg !9 -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_sol_qalloc.378.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.374.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !9 %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.9, %__hugr__.__tk2_sol_qalloc.378.exit.8, %__hugr__.__tk2_sol_qalloc.378.exit.7, %__hugr__.__tk2_sol_qalloc.378.exit.6, %__hugr__.__tk2_sol_qalloc.378.exit.5, %__hugr__.__tk2_sol_qalloc.378.exit.4, %__hugr__.__tk2_sol_qalloc.378.exit.3, %__hugr__.__tk2_sol_qalloc.378.exit.2, %__hugr__.__tk2_sol_qalloc.378.exit.1, %__hugr__.__tk2_sol_qalloc.378.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.374.exit.8, %__hugr__.__tk2_sol_qalloc.374.exit.7, %__hugr__.__tk2_sol_qalloc.374.exit.6, %__hugr__.__tk2_sol_qalloc.374.exit.5, %__hugr__.__tk2_sol_qalloc.374.exit.4, %__hugr__.__tk2_sol_qalloc.374.exit.3, %__hugr__.__tk2_sol_qalloc.374.exit.2, %__hugr__.__tk2_sol_qalloc.374.exit.1, %__hugr__.__tk2_sol_qalloc.374.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit +cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.374.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(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.1, !dbg !9 -__hugr__.__tk2_sol_qalloc.378.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.374.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 %5 = load i64, ptr %1, align 4 %6 = and i64 %5, 2 %.not199 = icmp eq i64 %6, 0 br i1 %.not199, label %panic.i, label %cond_exit_20.1 -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.374.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(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.2, !dbg !9 -__hugr__.__tk2_sol_qalloc.378.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.374.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 %9 = load i64, ptr %1, align 4 %10 = and i64 %9, 4 %.not200 = icmp eq i64 %10, 0 br i1 %.not200, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.374.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(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.3, !dbg !9 -__hugr__.__tk2_sol_qalloc.378.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.374.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 %13 = load i64, ptr %1, align 4 %14 = and i64 %13, 8 %.not201 = icmp eq i64 %14, 0 br i1 %.not201, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.374.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(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.4, !dbg !9 -__hugr__.__tk2_sol_qalloc.378.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.374.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 %17 = load i64, ptr %1, align 4 %18 = and i64 %17, 16 %.not202 = icmp eq i64 %18, 0 br i1 %.not202, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.374.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(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.5, !dbg !9 -__hugr__.__tk2_sol_qalloc.378.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.374.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 %21 = load i64, ptr %1, align 4 %22 = and i64 %21, 32 %.not203 = icmp eq i64 %22, 0 br i1 %.not203, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.374.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(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.6, !dbg !9 -__hugr__.__tk2_sol_qalloc.378.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.374.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 %25 = load i64, ptr %1, align 4 %26 = and i64 %25, 64 %.not204 = icmp eq i64 %26, 0 br i1 %.not204, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.374.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(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.7, !dbg !9 -__hugr__.__tk2_sol_qalloc.378.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.374.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 %29 = load i64, ptr %1, align 4 %30 = and i64 %29, 128 %.not205 = icmp eq i64 %30, 0 br i1 %.not205, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.374.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(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.8, !dbg !9 -__hugr__.__tk2_sol_qalloc.378.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.374.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 %33 = load i64, ptr %1, align 4 %34 = and i64 %33, 256 %.not206 = icmp eq i64 %34, 0 br i1 %.not206, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.374.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(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -399,16 +399,16 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 - %117 = lshr i64 %"425_1.sroa.10.0.i.i", 6 - %118 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %117 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 + %117 = lshr i64 %"421_1.sroa.10.0.i.i", 6 + %118 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %117 %119 = load i64, ptr %118, align 4 - %120 = and i64 %"425_1.sroa.10.0.i.i", 63 + %120 = and i64 %"421_1.sroa.10.0.i.i", 63 %121 = lshr i64 %119, %120 %122 = trunc i64 %121 to i1 - br i1 %122, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %122, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" %123 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" ], [ %265, %loop_body.i177 ] @@ -452,8 +452,8 @@ panic.i222.i.i: ; preds = %__barray_check_boun %exitcond.not.i.i.i185 = icmp eq i64 %.02.i.i.i182, %reass.sub.i.i.i179, !dbg !72 br i1 %exitcond.not.i.i.i185, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i181, !dbg !72 -mask_block_ok.i.i.i181: ; preds = %cond_exit_428.thread.9.i.i, %139 - %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_428.thread.9.i.i ] +mask_block_ok.i.i.i181: ; preds = %cond_exit_424.thread.9.i.i, %139 + %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_424.thread.9.i.i ] %gep.i.i.i183 = getelementptr i64, ptr %118, i64 %.02.i.i.i182, !dbg !72 %141 = load i64, ptr %gep.i.i.i183, align 4, !dbg !72 %142 = icmp eq i64 %141, -1, !dbg !72 @@ -467,183 +467,183 @@ __barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader %143 = shl nuw i64 1, %120, !dbg !71 %144 = xor i64 %119, %143, !dbg !71 store i64 %144, ptr %118, align 4, !dbg !71 - %145 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %"425_1.sroa.10.0.i.i" + %145 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %"421_1.sroa.10.0.i.i" %146 = load i64, ptr %145, align 4 tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %147 = add i64 %"425_1.sroa.10.0.i.i", 1 +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i + %147 = add i64 %"421_1.sroa.10.0.i.i", 1 %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %148 + %149 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i + br i1 %153, label %cond_exit_424.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_428.thread.i.i +__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_424.thread.i.i %154 = shl nuw i64 1, %151, !dbg !71 %155 = xor i64 %150, %154, !dbg !71 store i64 %155, ptr %149, align 4, !dbg !71 - %156 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %147 + %156 = getelementptr inbounds i64, ptr %"421_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_428.thread.1.i.i + br label %cond_exit_424.thread.1.i.i -cond_exit_428.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_428.thread.i.i - %158 = add i64 %"425_1.sroa.10.0.i.i", 2 +cond_exit_424.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_424.thread.i.i + %158 = add i64 %"421_1.sroa.10.0.i.i", 2 %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i + br i1 %164, label %cond_exit_424.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_428.thread.1.i.i +__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_424.thread.1.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %161, %165, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.2.i.i + br label %cond_exit_424.thread.2.i.i -cond_exit_428.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_428.thread.1.i.i - %169 = add i64 %"425_1.sroa.10.0.i.i", 3 +cond_exit_424.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_424.thread.1.i.i + %169 = add i64 %"421_1.sroa.10.0.i.i", 3 %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %170 + %171 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i + br i1 %175, label %cond_exit_424.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_428.thread.2.i.i +__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_424.thread.2.i.i %176 = shl nuw i64 1, %173, !dbg !71 %177 = xor i64 %172, %176, !dbg !71 store i64 %177, ptr %171, align 4, !dbg !71 - %178 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %169 + %178 = getelementptr inbounds i64, ptr %"421_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_428.thread.3.i.i + br label %cond_exit_424.thread.3.i.i -cond_exit_428.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_428.thread.2.i.i - %180 = add i64 %"425_1.sroa.10.0.i.i", 4 +cond_exit_424.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_424.thread.2.i.i + %180 = add i64 %"421_1.sroa.10.0.i.i", 4 %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %181 + %182 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i + br i1 %186, label %cond_exit_424.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_428.thread.3.i.i +__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_424.thread.3.i.i %187 = shl nuw i64 1, %184, !dbg !71 %188 = xor i64 %183, %187, !dbg !71 store i64 %188, ptr %182, align 4, !dbg !71 - %189 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %180 + %189 = getelementptr inbounds i64, ptr %"421_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_428.thread.4.i.i + br label %cond_exit_424.thread.4.i.i -cond_exit_428.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_428.thread.3.i.i - %191 = add i64 %"425_1.sroa.10.0.i.i", 5 +cond_exit_424.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_424.thread.3.i.i + %191 = add i64 %"421_1.sroa.10.0.i.i", 5 %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %192 + %193 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i + br i1 %197, label %cond_exit_424.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_428.thread.4.i.i +__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_424.thread.4.i.i %198 = shl nuw i64 1, %195, !dbg !71 %199 = xor i64 %194, %198, !dbg !71 store i64 %199, ptr %193, align 4, !dbg !71 - %200 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %191 + %200 = getelementptr inbounds i64, ptr %"421_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_428.thread.5.i.i + br label %cond_exit_424.thread.5.i.i -cond_exit_428.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_428.thread.4.i.i - %202 = add i64 %"425_1.sroa.10.0.i.i", 6 +cond_exit_424.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_424.thread.4.i.i + %202 = add i64 %"421_1.sroa.10.0.i.i", 6 %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %203 + %204 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i + br i1 %208, label %cond_exit_424.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_428.thread.5.i.i +__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_424.thread.5.i.i %209 = shl nuw i64 1, %206, !dbg !71 %210 = xor i64 %205, %209, !dbg !71 store i64 %210, ptr %204, align 4, !dbg !71 - %211 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %202 + %211 = getelementptr inbounds i64, ptr %"421_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_428.thread.6.i.i + br label %cond_exit_424.thread.6.i.i -cond_exit_428.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_428.thread.5.i.i - %213 = add i64 %"425_1.sroa.10.0.i.i", 7 +cond_exit_424.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_424.thread.5.i.i + %213 = add i64 %"421_1.sroa.10.0.i.i", 7 %214 = lshr i64 %213, 6 - %215 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %214 + %215 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %214 %216 = load i64, ptr %215, align 4 %217 = and i64 %213, 63 %218 = lshr i64 %216, %217 %219 = trunc i64 %218 to i1 - br i1 %219, label %cond_exit_428.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i + br i1 %219, label %cond_exit_424.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_428.thread.6.i.i +__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_424.thread.6.i.i %220 = shl nuw i64 1, %217, !dbg !71 %221 = xor i64 %216, %220, !dbg !71 store i64 %221, ptr %215, align 4, !dbg !71 - %222 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %213 + %222 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %213 %223 = load i64, ptr %222, align 4 tail call void @___dec_future_refcount(i64 %223) - br label %cond_exit_428.thread.7.i.i + br label %cond_exit_424.thread.7.i.i -cond_exit_428.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_428.thread.6.i.i - %224 = add i64 %"425_1.sroa.10.0.i.i", 8 +cond_exit_424.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_424.thread.6.i.i + %224 = add i64 %"421_1.sroa.10.0.i.i", 8 %225 = lshr i64 %224, 6 - %226 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %225 + %226 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %225 %227 = load i64, ptr %226, align 4 %228 = and i64 %224, 63 %229 = lshr i64 %227, %228 %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_428.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i + br i1 %230, label %cond_exit_424.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_428.thread.7.i.i +__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_424.thread.7.i.i %231 = shl nuw i64 1, %228, !dbg !71 %232 = xor i64 %227, %231, !dbg !71 store i64 %232, ptr %226, align 4, !dbg !71 - %233 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %224 + %233 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %224 %234 = load i64, ptr %233, align 4 tail call void @___dec_future_refcount(i64 %234) - br label %cond_exit_428.thread.8.i.i + br label %cond_exit_424.thread.8.i.i -cond_exit_428.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_428.thread.7.i.i - %235 = add i64 %"425_1.sroa.10.0.i.i", 9 +cond_exit_424.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_424.thread.7.i.i + %235 = add i64 %"421_1.sroa.10.0.i.i", 9 %236 = lshr i64 %235, 6 - %237 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %236 + %237 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %236 %238 = load i64, ptr %237, align 4 %239 = and i64 %235, 63 %240 = lshr i64 %238, %239 %241 = trunc i64 %240 to i1 - br i1 %241, label %cond_exit_428.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i + br i1 %241, label %cond_exit_424.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_428.thread.8.i.i +__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_424.thread.8.i.i %242 = shl nuw i64 1, %239, !dbg !71 %243 = xor i64 %238, %242, !dbg !71 store i64 %243, ptr %237, align 4, !dbg !71 - %244 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %235 + %244 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %235 %245 = load i64, ptr %244, align 4 tail call void @___dec_future_refcount(i64 %245) - br label %cond_exit_428.thread.9.i.i + br label %cond_exit_424.thread.9.i.i -cond_exit_428.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_428.thread.8.i.i +cond_exit_424.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_424.thread.8.i.i %246 = load i64, ptr %118, align 4, !dbg !72 %247 = sub nuw nsw i64 64, %120, !dbg !72 %248 = lshr i64 -1, %247, !dbg !72 @@ -687,9 +687,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %124, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_428.thread.9.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_424.thread.9.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %115) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol index 2863518d5..70c828970 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit, !dbg !8 -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.19.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.15.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol index ae60f7881..f74ad29c5 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol index 03d192419..cc7c30326 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit, !dbg !8 -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.42.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol index e44553352..4578def41 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 + %shot.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol index 4d603759d..142bb5af0 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit, !dbg !8 -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] +__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i, !dbg !15 -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol index 86e543e5a..4a439c466 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol @@ -14,9 +14,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_229_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_225_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol index ab374bea8..208637887 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit, !dbg !8 -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37, !dbg !10 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41, !dbg !11 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45, !dbg !13 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol index 4caae10f3..b79205d77 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol @@ -15,9 +15,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i - %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6, !dbg !72 - %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136, !dbg !72 +cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i + %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6, !dbg !72 + %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136, !dbg !72 %138 = load i64, ptr %137, align 4, !dbg !72 - %139 = and i64 %"425_1.sroa.10.0.i.i", 63, !dbg !72 + %139 = and i64 %"421_1.sroa.10.0.i.i", 63, !dbg !72 %140 = sub nuw nsw i64 64, %139, !dbg !72 %141 = lshr i64 -1, %140, !dbg !72 %142 = icmp eq i64 %139, 0, !dbg !72 %143 = select i1 %142, i64 0, i64 %141, !dbg !72 %144 = or i64 %138, %143, !dbg !72 store i64 %144, ptr %137, align 4, !dbg !72 - %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9, !dbg !72 + %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9, !dbg !72 %145 = lshr i64 %last_valid.i.i.i179, 6, !dbg !72 - %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145, !dbg !72 + %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145, !dbg !72 %147 = load i64, ptr %146, align 4, !dbg !72 %148 = and i64 %last_valid.i.i.i179, 63, !dbg !72 %149 = shl nsw i64 -2, %148, !dbg !72 @@ -474,8 +474,8 @@ cond_428_case_0.i.i: ; preds = %cond_exit_428.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180, !dbg !72 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182, !dbg !72 -mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183, !dbg !72 %155 = load i64, ptr %gep.i.i.i184, align 4, !dbg !72 %156 = icmp eq i64 %155, -1, !dbg !72 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0"), !dbg !72 unreachable, !dbg !72 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i - %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] - %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 - %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i + %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] + %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 + %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %165, %161, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol index 3f4ac4f6e..066aa9e13 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit, !dbg !8 -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.19.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.15.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol index 1051c04c0..33f773d90 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol index 8eecfb815..24a5a695b 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit, !dbg !8 -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.42.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol index a289e68a7..f778f2dd0 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 + %shot.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol index 9a241c067..bf434b8d5 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit, !dbg !8 -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] +__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i, !dbg !15 -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol index 3a2218ef8..c2fe49921 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol @@ -14,9 +14,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_229_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_225_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol index 70d9e4b25..f643fd53f 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit, !dbg !8 -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37, !dbg !10 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41, !dbg !11 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45, !dbg !13 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol index 22adec2b4..df93cb621 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol @@ -15,9 +15,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i - %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6, !dbg !72 - %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136, !dbg !72 +cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i + %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6, !dbg !72 + %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136, !dbg !72 %138 = load i64, ptr %137, align 4, !dbg !72 - %139 = and i64 %"425_1.sroa.10.0.i.i", 63, !dbg !72 + %139 = and i64 %"421_1.sroa.10.0.i.i", 63, !dbg !72 %140 = sub nuw nsw i64 64, %139, !dbg !72 %141 = lshr i64 -1, %140, !dbg !72 %142 = icmp eq i64 %139, 0, !dbg !72 %143 = select i1 %142, i64 0, i64 %141, !dbg !72 %144 = or i64 %138, %143, !dbg !72 store i64 %144, ptr %137, align 4, !dbg !72 - %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9, !dbg !72 + %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9, !dbg !72 %145 = lshr i64 %last_valid.i.i.i179, 6, !dbg !72 - %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145, !dbg !72 + %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145, !dbg !72 %147 = load i64, ptr %146, align 4, !dbg !72 %148 = and i64 %last_valid.i.i.i179, 63, !dbg !72 %149 = shl nsw i64 -2, %148, !dbg !72 @@ -474,8 +474,8 @@ cond_428_case_0.i.i: ; preds = %cond_exit_428.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180, !dbg !72 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182, !dbg !72 -mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183, !dbg !72 %155 = load i64, ptr %gep.i.i.i184, align 4, !dbg !72 %156 = icmp eq i64 %155, -1, !dbg !72 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0"), !dbg !72 unreachable, !dbg !72 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i - %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] - %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 - %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i + %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] + %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 + %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %165, %161, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol index 643441c6c..c765e9a57 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit, !dbg !8 -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.19.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.15.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol index c1ad73446..fbdf07204 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol index 7dcee3a4f..a78b11e0f 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit, !dbg !8 -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.42.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol index f17bfa910..60e63f416 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 + %shot.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol index 7ba892671..be36f3414 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit, !dbg !8 -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] +__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i, !dbg !15 -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol index 25f3acf19..e589051cc 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol @@ -14,9 +14,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_229_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_229_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_229_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_229_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_229_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_229_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_229_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_229_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_229_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_229_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_225_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol index 26c207afa..caeeeb659 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr 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_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit, !dbg !8 -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.40.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.36.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x400921FB54442D18, double 0.000000e+00), !dbg !9 %qalloc.i34 = tail call i64 @___qalloc(), !dbg !10 %not_max.not.not.i35 = icmp eq i64 %qalloc.i34, -1, !dbg !10 - br i1 %not_max.not.not.i35, label %cond_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37, !dbg !10 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37, !dbg !10 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !10 unreachable, !dbg !10 -__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34), !dbg !10 %qalloc.i38 = tail call i64 @___qalloc(), !dbg !11 %not_max.not.not.i39 = icmp eq i64 %qalloc.i38, -1, !dbg !11 - br i1 %not_max.not.not.i39, label %cond_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41, !dbg !11 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41, !dbg !11 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !11 unreachable, !dbg !11 -__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38), !dbg !11 tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00), !dbg !12 %qalloc.i42 = tail call i64 @___qalloc(), !dbg !13 %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1, !dbg !13 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45, !dbg !13 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45, !dbg !13 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !13 unreachable, !dbg !13 -__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42), !dbg !13 %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i), !dbg !14 tail call void @___qfree(i64 %qalloc.i), !dbg !14 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol index 6cce3a02c..6db48e2c9 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol @@ -15,9 +15,9 @@ alloca_block: store i64 -1, ptr %1, align 1, !dbg !8 %qalloc.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i = icmp eq i64 %qalloc.i, -1, !dbg !9 - br i1 %not_max.not.not.i, label %cond_405_case_0.i, label %__barray_check_bounds.exit, !dbg !9 + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit, !dbg !9 -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun store i64 %qalloc.i, ptr %0, align 4 %qalloc.i.1 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.1 = icmp eq i64 %qalloc.i.1, -1, !dbg !9 - br i1 %not_max.not.not.i.1, label %cond_405_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 + br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__barray_check_bounds.exit.1, !dbg !9 __barray_check_bounds.exit.1: ; preds = %cond_exit_20 tail call void @___reset(i64 %qalloc.i.1), !dbg !9 @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun store i64 %qalloc.i.1, ptr %8, align 4 %qalloc.i.2 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.2 = icmp eq i64 %qalloc.i.2, -1, !dbg !9 - br i1 %not_max.not.not.i.2, label %cond_405_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 + br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__barray_check_bounds.exit.2, !dbg !9 __barray_check_bounds.exit.2: ; preds = %cond_exit_20.1 tail call void @___reset(i64 %qalloc.i.2), !dbg !9 @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun store i64 %qalloc.i.2, ptr %12, align 4 %qalloc.i.3 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.3 = icmp eq i64 %qalloc.i.3, -1, !dbg !9 - br i1 %not_max.not.not.i.3, label %cond_405_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 + br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__barray_check_bounds.exit.3, !dbg !9 __barray_check_bounds.exit.3: ; preds = %cond_exit_20.2 tail call void @___reset(i64 %qalloc.i.3), !dbg !9 @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun store i64 %qalloc.i.3, ptr %16, align 4 %qalloc.i.4 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.4 = icmp eq i64 %qalloc.i.4, -1, !dbg !9 - br i1 %not_max.not.not.i.4, label %cond_405_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 + br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__barray_check_bounds.exit.4, !dbg !9 __barray_check_bounds.exit.4: ; preds = %cond_exit_20.3 tail call void @___reset(i64 %qalloc.i.4), !dbg !9 @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun store i64 %qalloc.i.4, ptr %20, align 4 %qalloc.i.5 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.5 = icmp eq i64 %qalloc.i.5, -1, !dbg !9 - br i1 %not_max.not.not.i.5, label %cond_405_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 + br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__barray_check_bounds.exit.5, !dbg !9 __barray_check_bounds.exit.5: ; preds = %cond_exit_20.4 tail call void @___reset(i64 %qalloc.i.5), !dbg !9 @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun store i64 %qalloc.i.5, ptr %24, align 4 %qalloc.i.6 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.6 = icmp eq i64 %qalloc.i.6, -1, !dbg !9 - br i1 %not_max.not.not.i.6, label %cond_405_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 + br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__barray_check_bounds.exit.6, !dbg !9 __barray_check_bounds.exit.6: ; preds = %cond_exit_20.5 tail call void @___reset(i64 %qalloc.i.6), !dbg !9 @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun store i64 %qalloc.i.6, ptr %28, align 4 %qalloc.i.7 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.7 = icmp eq i64 %qalloc.i.7, -1, !dbg !9 - br i1 %not_max.not.not.i.7, label %cond_405_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 + br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__barray_check_bounds.exit.7, !dbg !9 __barray_check_bounds.exit.7: ; preds = %cond_exit_20.6 tail call void @___reset(i64 %qalloc.i.7), !dbg !9 @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun store i64 %qalloc.i.7, ptr %32, align 4 %qalloc.i.8 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.8 = icmp eq i64 %qalloc.i.8, -1, !dbg !9 - br i1 %not_max.not.not.i.8, label %cond_405_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 + br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__barray_check_bounds.exit.8, !dbg !9 __barray_check_bounds.exit.8: ; preds = %cond_exit_20.7 tail call void @___reset(i64 %qalloc.i.8), !dbg !9 @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun store i64 %qalloc.i.8, ptr %36, align 4 %qalloc.i.9 = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.9 = icmp eq i64 %qalloc.i.9, -1, !dbg !9 - br i1 %not_max.not.not.i.9, label %cond_405_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 + br i1 %not_max.not.not.i.9, label %cond_401_case_0.i, label %__barray_check_bounds.exit.9, !dbg !9 __barray_check_bounds.exit.9: ; preds = %cond_exit_20.8 tail call void @___reset(i64 %qalloc.i.9), !dbg !9 @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i - %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6, !dbg !72 - %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136, !dbg !72 +cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i + %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6, !dbg !72 + %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136, !dbg !72 %138 = load i64, ptr %137, align 4, !dbg !72 - %139 = and i64 %"425_1.sroa.10.0.i.i", 63, !dbg !72 + %139 = and i64 %"421_1.sroa.10.0.i.i", 63, !dbg !72 %140 = sub nuw nsw i64 64, %139, !dbg !72 %141 = lshr i64 -1, %140, !dbg !72 %142 = icmp eq i64 %139, 0, !dbg !72 %143 = select i1 %142, i64 0, i64 %141, !dbg !72 %144 = or i64 %138, %143, !dbg !72 store i64 %144, ptr %137, align 4, !dbg !72 - %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9, !dbg !72 + %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9, !dbg !72 %145 = lshr i64 %last_valid.i.i.i179, 6, !dbg !72 - %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145, !dbg !72 + %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145, !dbg !72 %147 = load i64, ptr %146, align 4, !dbg !72 %148 = and i64 %last_valid.i.i.i179, 63, !dbg !72 %149 = shl nsw i64 -2, %148, !dbg !72 @@ -474,8 +474,8 @@ cond_428_case_0.i.i: ; preds = %cond_exit_428.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180, !dbg !72 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182, !dbg !72 -mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183, !dbg !72 %155 = load i64, ptr %gep.i.i.i184, align 4, !dbg !72 %156 = icmp eq i64 %155, -1, !dbg !72 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0"), !dbg !72 unreachable, !dbg !72 -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i - %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] - %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 - %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i + %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] + %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 + %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162, !dbg !71 %166 = xor i64 %165, %161, !dbg !71 store i64 %166, ptr %160, align 4, !dbg !71 - %167 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10, !dbg !74 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol index ebd870e87..19430a132 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr 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_23_case_0.i, label %__hugr__.__tk2_sol_qalloc.19.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit, !dbg !8 -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.19.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.15.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol index fb57221c5..37186b72b 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed 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_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit, !dbg !8 -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.40.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.44.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol index 0dd9d4eb9..844943faf 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname 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_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit, !dbg !8 -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.38.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !9 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !9 @@ -27,11 +27,11 @@ __hugr__.__tk2_sol_qalloc.42.exit: ; preds = %alloca_block tail call void @___dec_future_refcount(i64 %lazy_measure), !dbg !10 br i1 %read_bool, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false), !dbg !11 ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0), !dbg !12 unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol index f20a6c06e..66030e5fd 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr !dbg !10 { entry: tail call void @setup(i64 %0), !dbg !15 - %shot.i.i = tail call i64 @get_current_shot(), !dbg !16 - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i), !dbg !18 + %shot.i = tail call i64 @get_current_shot(), !dbg !16 + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i), !dbg !18 %1 = tail call i64 @teardown(), !dbg !15 ret i64 %1, !dbg !15 } diff --git a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol index 742cd3358..c51ef830b 100644 --- a/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_basic_generation/test_llvm/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr !dbg ! 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_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit, !dbg !8 + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit, !dbg !8 -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i), !dbg !8 %qalloc.i98.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1, !dbg !9 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !9 unreachable, !dbg !9 -__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] +__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i), !dbg !9 %qalloc.i91.i = tail call i64 @___qalloc(), !dbg !15 %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1, !dbg !15 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i, !dbg !15 + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i, !dbg !15 -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0"), !dbg !15 unreachable, !dbg !15 -__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i), !dbg !15 tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18), !dbg !16 tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18), !dbg !16 @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i), !dbg !22 br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.i), !dbg !29 br label %.backedge.i .backedge.i: ; preds = %2, %0 %qalloc.i.i = tail call i64 @___qalloc(), !dbg !9 %not_max.not.not.i.i = icmp eq i64 %qalloc.i.i, -1, !dbg !9 - br i1 %not_max.not.not.i.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i, !dbg !9 + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i, !dbg !9 -1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18), !dbg !30 tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18), !dbg !31 tail call void @___rp(i64 %qalloc.i, double 0x3FF921FB54442D18, double 0x3FF921FB54442D18), !dbg !32 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_helios index f473a8cef..c64047453 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_helios @@ -14,157 +14,157 @@ alloca_block: 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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.225.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.221.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.9, %__hugr__.__tk2_helios_qalloc.225.exit.8, %__hugr__.__tk2_helios_qalloc.225.exit.7, %__hugr__.__tk2_helios_qalloc.225.exit.6, %__hugr__.__tk2_helios_qalloc.225.exit.5, %__hugr__.__tk2_helios_qalloc.225.exit.4, %__hugr__.__tk2_helios_qalloc.225.exit.3, %__hugr__.__tk2_helios_qalloc.225.exit.2, %__hugr__.__tk2_helios_qalloc.225.exit.1, %__hugr__.__tk2_helios_qalloc.225.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.221.exit.8, %__hugr__.__tk2_helios_qalloc.221.exit.7, %__hugr__.__tk2_helios_qalloc.221.exit.6, %__hugr__.__tk2_helios_qalloc.221.exit.5, %__hugr__.__tk2_helios_qalloc.221.exit.4, %__hugr__.__tk2_helios_qalloc.221.exit.3, %__hugr__.__tk2_helios_qalloc.221.exit.2, %__hugr__.__tk2_helios_qalloc.221.exit.1, %__hugr__.__tk2_helios_qalloc.221.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit +cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.1 + br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.1 -__hugr__.__tk2_helios_qalloc.225.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.221.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.225.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.2 + br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.2 -__hugr__.__tk2_helios_qalloc.225.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.221.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 %.not117 = icmp eq i64 %10, 0 br i1 %.not117, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.3 + br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.3 -__hugr__.__tk2_helios_qalloc.225.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_helios_qalloc.221.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 %.not118 = icmp eq i64 %14, 0 br i1 %.not118, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.4 + br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.4 -__hugr__.__tk2_helios_qalloc.225.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_helios_qalloc.221.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 %.not119 = icmp eq i64 %18, 0 br i1 %.not119, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.5 + br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.5 -__hugr__.__tk2_helios_qalloc.225.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_helios_qalloc.221.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 %.not120 = icmp eq i64 %22, 0 br i1 %.not120, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.6 + br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.6 -__hugr__.__tk2_helios_qalloc.225.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_helios_qalloc.221.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 %.not121 = icmp eq i64 %26, 0 br i1 %.not121, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.7 + br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.7 -__hugr__.__tk2_helios_qalloc.225.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_helios_qalloc.221.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 %.not122 = icmp eq i64 %30, 0 br i1 %.not122, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.8 + br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.8 -__hugr__.__tk2_helios_qalloc.225.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_helios_qalloc.221.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 %.not123 = icmp eq i64 %34, 0 br i1 %.not123, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_225_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_helios index ad2d7cbab..2d9277dc2 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.36.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_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34) %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_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios index 2fe74384f..d97baac8e 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_helios @@ -15,157 +15,157 @@ alloca_block: 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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.378.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.374.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.9, %__hugr__.__tk2_helios_qalloc.378.exit.8, %__hugr__.__tk2_helios_qalloc.378.exit.7, %__hugr__.__tk2_helios_qalloc.378.exit.6, %__hugr__.__tk2_helios_qalloc.378.exit.5, %__hugr__.__tk2_helios_qalloc.378.exit.4, %__hugr__.__tk2_helios_qalloc.378.exit.3, %__hugr__.__tk2_helios_qalloc.378.exit.2, %__hugr__.__tk2_helios_qalloc.378.exit.1, %__hugr__.__tk2_helios_qalloc.378.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.374.exit.8, %__hugr__.__tk2_helios_qalloc.374.exit.7, %__hugr__.__tk2_helios_qalloc.374.exit.6, %__hugr__.__tk2_helios_qalloc.374.exit.5, %__hugr__.__tk2_helios_qalloc.374.exit.4, %__hugr__.__tk2_helios_qalloc.374.exit.3, %__hugr__.__tk2_helios_qalloc.374.exit.2, %__hugr__.__tk2_helios_qalloc.374.exit.1, %__hugr__.__tk2_helios_qalloc.374.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit +cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.1 + br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.1 -__hugr__.__tk2_helios_qalloc.378.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.374.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 %.not199 = icmp eq i64 %6, 0 br i1 %.not199, label %panic.i, label %cond_exit_20.1 -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.2 + br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.2 -__hugr__.__tk2_helios_qalloc.378.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.374.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 %.not200 = icmp eq i64 %10, 0 br i1 %.not200, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.3 + br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.3 -__hugr__.__tk2_helios_qalloc.378.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_helios_qalloc.374.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 %.not201 = icmp eq i64 %14, 0 br i1 %.not201, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.4 + br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.4 -__hugr__.__tk2_helios_qalloc.378.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_helios_qalloc.374.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 %.not202 = icmp eq i64 %18, 0 br i1 %.not202, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.5 + br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.5 -__hugr__.__tk2_helios_qalloc.378.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_helios_qalloc.374.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 %.not203 = icmp eq i64 %22, 0 br i1 %.not203, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.6 + br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.6 -__hugr__.__tk2_helios_qalloc.378.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_helios_qalloc.374.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 %.not204 = icmp eq i64 %26, 0 br i1 %.not204, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.7 + br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.7 -__hugr__.__tk2_helios_qalloc.378.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_helios_qalloc.374.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 %.not205 = icmp eq i64 %30, 0 br i1 %.not205, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.8 + br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.8 -__hugr__.__tk2_helios_qalloc.378.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_helios_qalloc.374.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 %.not206 = icmp eq i64 %34, 0 br i1 %.not206, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_401_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) @@ -399,16 +399,16 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 - %117 = lshr i64 %"425_1.sroa.10.0.i.i", 6 - %118 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %117 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 + %117 = lshr i64 %"421_1.sroa.10.0.i.i", 6 + %118 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %117 %119 = load i64, ptr %118, align 4 - %120 = and i64 %"425_1.sroa.10.0.i.i", 63 + %120 = and i64 %"421_1.sroa.10.0.i.i", 63 %121 = lshr i64 %119, %120 %122 = trunc i64 %121 to i1 - br i1 %122, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %122, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" %123 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" ], [ %265, %loop_body.i177 ] @@ -452,8 +452,8 @@ panic.i222.i.i: ; preds = %__barray_check_boun %exitcond.not.i.i.i185 = icmp eq i64 %.02.i.i.i182, %reass.sub.i.i.i179 br i1 %exitcond.not.i.i.i185, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i181 -mask_block_ok.i.i.i181: ; preds = %cond_exit_428.thread.9.i.i, %139 - %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_428.thread.9.i.i ] +mask_block_ok.i.i.i181: ; preds = %cond_exit_424.thread.9.i.i, %139 + %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_424.thread.9.i.i ] %gep.i.i.i183 = getelementptr i64, ptr %118, i64 %.02.i.i.i182 %141 = load i64, ptr %gep.i.i.i183, align 4 %142 = icmp eq i64 %141, -1 @@ -467,183 +467,183 @@ __barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader %143 = shl nuw i64 1, %120 %144 = xor i64 %119, %143 store i64 %144, ptr %118, align 4 - %145 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %"425_1.sroa.10.0.i.i" + %145 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %"421_1.sroa.10.0.i.i" %146 = load i64, ptr %145, align 4 tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %147 = add i64 %"425_1.sroa.10.0.i.i", 1 +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i + %147 = add i64 %"421_1.sroa.10.0.i.i", 1 %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %148 + %149 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i + br i1 %153, label %cond_exit_424.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_428.thread.i.i +__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_424.thread.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 %"425_1.sroa.0.0.i.i", i64 %147 + %156 = getelementptr inbounds i64, ptr %"421_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_428.thread.1.i.i + br label %cond_exit_424.thread.1.i.i -cond_exit_428.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_428.thread.i.i - %158 = add i64 %"425_1.sroa.10.0.i.i", 2 +cond_exit_424.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_424.thread.i.i + %158 = add i64 %"421_1.sroa.10.0.i.i", 2 %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i + br i1 %164, label %cond_exit_424.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_428.thread.1.i.i +__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_424.thread.1.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 %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.2.i.i + br label %cond_exit_424.thread.2.i.i -cond_exit_428.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_428.thread.1.i.i - %169 = add i64 %"425_1.sroa.10.0.i.i", 3 +cond_exit_424.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_424.thread.1.i.i + %169 = add i64 %"421_1.sroa.10.0.i.i", 3 %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %170 + %171 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i + br i1 %175, label %cond_exit_424.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_428.thread.2.i.i +__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_424.thread.2.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 %"425_1.sroa.0.0.i.i", i64 %169 + %178 = getelementptr inbounds i64, ptr %"421_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_428.thread.3.i.i + br label %cond_exit_424.thread.3.i.i -cond_exit_428.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_428.thread.2.i.i - %180 = add i64 %"425_1.sroa.10.0.i.i", 4 +cond_exit_424.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_424.thread.2.i.i + %180 = add i64 %"421_1.sroa.10.0.i.i", 4 %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %181 + %182 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i + br i1 %186, label %cond_exit_424.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_428.thread.3.i.i +__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_424.thread.3.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 %"425_1.sroa.0.0.i.i", i64 %180 + %189 = getelementptr inbounds i64, ptr %"421_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_428.thread.4.i.i + br label %cond_exit_424.thread.4.i.i -cond_exit_428.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_428.thread.3.i.i - %191 = add i64 %"425_1.sroa.10.0.i.i", 5 +cond_exit_424.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_424.thread.3.i.i + %191 = add i64 %"421_1.sroa.10.0.i.i", 5 %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %192 + %193 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i + br i1 %197, label %cond_exit_424.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_428.thread.4.i.i +__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_424.thread.4.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 %"425_1.sroa.0.0.i.i", i64 %191 + %200 = getelementptr inbounds i64, ptr %"421_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_428.thread.5.i.i + br label %cond_exit_424.thread.5.i.i -cond_exit_428.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_428.thread.4.i.i - %202 = add i64 %"425_1.sroa.10.0.i.i", 6 +cond_exit_424.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_424.thread.4.i.i + %202 = add i64 %"421_1.sroa.10.0.i.i", 6 %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %203 + %204 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i + br i1 %208, label %cond_exit_424.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_428.thread.5.i.i +__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_424.thread.5.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 %"425_1.sroa.0.0.i.i", i64 %202 + %211 = getelementptr inbounds i64, ptr %"421_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_428.thread.6.i.i + br label %cond_exit_424.thread.6.i.i -cond_exit_428.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_428.thread.5.i.i - %213 = add i64 %"425_1.sroa.10.0.i.i", 7 +cond_exit_424.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_424.thread.5.i.i + %213 = add i64 %"421_1.sroa.10.0.i.i", 7 %214 = lshr i64 %213, 6 - %215 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %214 + %215 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %214 %216 = load i64, ptr %215, align 4 %217 = and i64 %213, 63 %218 = lshr i64 %216, %217 %219 = trunc i64 %218 to i1 - br i1 %219, label %cond_exit_428.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i + br i1 %219, label %cond_exit_424.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_428.thread.6.i.i +__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_424.thread.6.i.i %220 = shl nuw i64 1, %217 %221 = xor i64 %216, %220 store i64 %221, ptr %215, align 4 - %222 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %213 + %222 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %213 %223 = load i64, ptr %222, align 4 tail call void @___dec_future_refcount(i64 %223) - br label %cond_exit_428.thread.7.i.i + br label %cond_exit_424.thread.7.i.i -cond_exit_428.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_428.thread.6.i.i - %224 = add i64 %"425_1.sroa.10.0.i.i", 8 +cond_exit_424.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_424.thread.6.i.i + %224 = add i64 %"421_1.sroa.10.0.i.i", 8 %225 = lshr i64 %224, 6 - %226 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %225 + %226 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %225 %227 = load i64, ptr %226, align 4 %228 = and i64 %224, 63 %229 = lshr i64 %227, %228 %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_428.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i + br i1 %230, label %cond_exit_424.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_428.thread.7.i.i +__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_424.thread.7.i.i %231 = shl nuw i64 1, %228 %232 = xor i64 %227, %231 store i64 %232, ptr %226, align 4 - %233 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %224 + %233 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %224 %234 = load i64, ptr %233, align 4 tail call void @___dec_future_refcount(i64 %234) - br label %cond_exit_428.thread.8.i.i + br label %cond_exit_424.thread.8.i.i -cond_exit_428.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_428.thread.7.i.i - %235 = add i64 %"425_1.sroa.10.0.i.i", 9 +cond_exit_424.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_424.thread.7.i.i + %235 = add i64 %"421_1.sroa.10.0.i.i", 9 %236 = lshr i64 %235, 6 - %237 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %236 + %237 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %236 %238 = load i64, ptr %237, align 4 %239 = and i64 %235, 63 %240 = lshr i64 %238, %239 %241 = trunc i64 %240 to i1 - br i1 %241, label %cond_exit_428.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i + br i1 %241, label %cond_exit_424.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_428.thread.8.i.i +__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_424.thread.8.i.i %242 = shl nuw i64 1, %239 %243 = xor i64 %238, %242 store i64 %243, ptr %237, align 4 - %244 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %235 + %244 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %235 %245 = load i64, ptr %244, align 4 tail call void @___dec_future_refcount(i64 %245) - br label %cond_exit_428.thread.9.i.i + br label %cond_exit_424.thread.9.i.i -cond_exit_428.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_428.thread.8.i.i +cond_exit_424.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_424.thread.8.i.i %246 = load i64, ptr %118, align 4 %247 = sub nuw nsw i64 64, %120 %248 = lshr i64 -1, %247 @@ -687,9 +687,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %124, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_428.thread.9.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_424.thread.9.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %115) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios index 8ea26533f..b23bf7a6a 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.15.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios index 76c013625..5f3d91892 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.40.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.44.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.44.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios index 6de097e5c..a95b80c78 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.38.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.42.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.42.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios index 90be7a009..4fed018b2 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) + %shot.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_helios index 5a715d81c..cc28debf2 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_helios @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_604_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_600_case_0.i, label %__barray_check_bounds.exit -cond_604_case_0.i: ; preds = %cond_20_case_1 +cond_600_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"624_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"624_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"624_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"620_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"620_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"620_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_627_case_0.i.i: ; preds = %cond_exit_627.thread.i.i - %85 = lshr i64 %"624_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"624_1.sroa.5.0.i.i", i64 %85 +cond_623_case_0.i.i: ; preds = %cond_exit_623.thread.i.i + %85 = lshr i64 %"620_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"620_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"624_1.sroa.10.0.i.i", 63 + %88 = and i64 %"620_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"624_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"620_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_627_case_0.i.i: ; preds = %cond_exit_627.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_627_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_627_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_623_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_623_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_627.thread.i.i, %loop_body.preheader.i.i - %"624_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_627.thread.i.i ] - %106 = add nuw nsw i64 %"624_0.0239.i.i", 1 - %107 = add i64 %"624_0.0239.i.i", %"624_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_623.thread.i.i, %loop_body.preheader.i.i + %"620_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_623.thread.i.i ] + %106 = add nuw nsw i64 %"620_0.0239.i.i", 1 + %107 = add i64 %"620_0.0239.i.i", %"620_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_627.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_623.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"624_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"620_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_627.thread.i.i + br label %cond_exit_623.thread.i.i -cond_exit_627.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_623.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_627_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_623_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_627_case_0.i.i - tail call void @heap_free(ptr %"624_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"624_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_623_case_0.i.i + tail call void @heap_free(ptr %"620_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"620_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios index 6dc3be766..83bdf320e 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] +__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i -1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_helios index 5113e18bf..83c604596 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_helios @@ -14,157 +14,157 @@ alloca_block: 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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.225.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.221.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.9, %__hugr__.__tk2_helios_qalloc.225.exit.8, %__hugr__.__tk2_helios_qalloc.225.exit.7, %__hugr__.__tk2_helios_qalloc.225.exit.6, %__hugr__.__tk2_helios_qalloc.225.exit.5, %__hugr__.__tk2_helios_qalloc.225.exit.4, %__hugr__.__tk2_helios_qalloc.225.exit.3, %__hugr__.__tk2_helios_qalloc.225.exit.2, %__hugr__.__tk2_helios_qalloc.225.exit.1, %__hugr__.__tk2_helios_qalloc.225.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.221.exit.8, %__hugr__.__tk2_helios_qalloc.221.exit.7, %__hugr__.__tk2_helios_qalloc.221.exit.6, %__hugr__.__tk2_helios_qalloc.221.exit.5, %__hugr__.__tk2_helios_qalloc.221.exit.4, %__hugr__.__tk2_helios_qalloc.221.exit.3, %__hugr__.__tk2_helios_qalloc.221.exit.2, %__hugr__.__tk2_helios_qalloc.221.exit.1, %__hugr__.__tk2_helios_qalloc.221.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit +cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.1 + br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.1 -__hugr__.__tk2_helios_qalloc.225.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.221.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.225.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.2 + br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.2 -__hugr__.__tk2_helios_qalloc.225.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.221.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 %.not117 = icmp eq i64 %10, 0 br i1 %.not117, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.3 + br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.3 -__hugr__.__tk2_helios_qalloc.225.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_helios_qalloc.221.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 %.not118 = icmp eq i64 %14, 0 br i1 %.not118, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.4 + br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.4 -__hugr__.__tk2_helios_qalloc.225.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_helios_qalloc.221.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 %.not119 = icmp eq i64 %18, 0 br i1 %.not119, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.5 + br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.5 -__hugr__.__tk2_helios_qalloc.225.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_helios_qalloc.221.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 %.not120 = icmp eq i64 %22, 0 br i1 %.not120, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.6 + br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.6 -__hugr__.__tk2_helios_qalloc.225.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_helios_qalloc.221.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 %.not121 = icmp eq i64 %26, 0 br i1 %.not121, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.7 + br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.7 -__hugr__.__tk2_helios_qalloc.225.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_helios_qalloc.221.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 %.not122 = icmp eq i64 %30, 0 br i1 %.not122, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_helios_qalloc.225.exit.8 + br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__hugr__.__tk2_helios_qalloc.221.exit.8 -__hugr__.__tk2_helios_qalloc.225.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_helios_qalloc.221.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 %.not123 = icmp eq i64 %34, 0 br i1 %.not123, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.225.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.221.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_229_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_225_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_helios index e5ab1f660..073e3cfac 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.36.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_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34) %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_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_helios index 6485ed74a..3844172a3 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_helios @@ -15,157 +15,157 @@ alloca_block: 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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.378.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.374.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.9, %__hugr__.__tk2_helios_qalloc.378.exit.8, %__hugr__.__tk2_helios_qalloc.378.exit.7, %__hugr__.__tk2_helios_qalloc.378.exit.6, %__hugr__.__tk2_helios_qalloc.378.exit.5, %__hugr__.__tk2_helios_qalloc.378.exit.4, %__hugr__.__tk2_helios_qalloc.378.exit.3, %__hugr__.__tk2_helios_qalloc.378.exit.2, %__hugr__.__tk2_helios_qalloc.378.exit.1, %__hugr__.__tk2_helios_qalloc.378.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_helios_qalloc.374.exit.8, %__hugr__.__tk2_helios_qalloc.374.exit.7, %__hugr__.__tk2_helios_qalloc.374.exit.6, %__hugr__.__tk2_helios_qalloc.374.exit.5, %__hugr__.__tk2_helios_qalloc.374.exit.4, %__hugr__.__tk2_helios_qalloc.374.exit.3, %__hugr__.__tk2_helios_qalloc.374.exit.2, %__hugr__.__tk2_helios_qalloc.374.exit.1, %__hugr__.__tk2_helios_qalloc.374.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit +cond_exit_20: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.1 + br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.1 -__hugr__.__tk2_helios_qalloc.378.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_helios_qalloc.374.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 %.not199 = icmp eq i64 %6, 0 br i1 %.not199, label %panic.i, label %cond_exit_20.1 -cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.2 + br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.2 -__hugr__.__tk2_helios_qalloc.378.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_helios_qalloc.374.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 %.not200 = icmp eq i64 %10, 0 br i1 %.not200, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.3 + br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.3 -__hugr__.__tk2_helios_qalloc.378.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_helios_qalloc.374.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 %.not201 = icmp eq i64 %14, 0 br i1 %.not201, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.4 + br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.4 -__hugr__.__tk2_helios_qalloc.378.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_helios_qalloc.374.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 %.not202 = icmp eq i64 %18, 0 br i1 %.not202, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.5 + br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.5 -__hugr__.__tk2_helios_qalloc.378.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_helios_qalloc.374.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 %.not203 = icmp eq i64 %22, 0 br i1 %.not203, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.6 + br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.6 -__hugr__.__tk2_helios_qalloc.378.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_helios_qalloc.374.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 %.not204 = icmp eq i64 %26, 0 br i1 %.not204, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.7 + br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.7 -__hugr__.__tk2_helios_qalloc.378.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_helios_qalloc.374.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 %.not205 = icmp eq i64 %30, 0 br i1 %.not205, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_helios_qalloc.378.exit.8 + br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__hugr__.__tk2_helios_qalloc.374.exit.8 -__hugr__.__tk2_helios_qalloc.378.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_helios_qalloc.374.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 %.not206 = icmp eq i64 %34, 0 br i1 %.not206, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.378.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_helios_qalloc.374.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_405_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_401_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) @@ -399,16 +399,16 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 - %117 = lshr i64 %"425_1.sroa.10.0.i.i", 6 - %118 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %117 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 + %117 = lshr i64 %"421_1.sroa.10.0.i.i", 6 + %118 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %117 %119 = load i64, ptr %118, align 4 - %120 = and i64 %"425_1.sroa.10.0.i.i", 63 + %120 = and i64 %"421_1.sroa.10.0.i.i", 63 %121 = lshr i64 %119, %120 %122 = trunc i64 %121 to i1 - br i1 %122, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %122, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" %123 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" ], [ %265, %loop_body.i177 ] @@ -452,8 +452,8 @@ panic.i222.i.i: ; preds = %__barray_check_boun %exitcond.not.i.i.i185 = icmp eq i64 %.02.i.i.i182, %reass.sub.i.i.i179 br i1 %exitcond.not.i.i.i185, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i181 -mask_block_ok.i.i.i181: ; preds = %cond_exit_428.thread.9.i.i, %139 - %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_428.thread.9.i.i ] +mask_block_ok.i.i.i181: ; preds = %cond_exit_424.thread.9.i.i, %139 + %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_424.thread.9.i.i ] %gep.i.i.i183 = getelementptr i64, ptr %118, i64 %.02.i.i.i182 %141 = load i64, ptr %gep.i.i.i183, align 4 %142 = icmp eq i64 %141, -1 @@ -467,183 +467,183 @@ __barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader %143 = shl nuw i64 1, %120 %144 = xor i64 %119, %143 store i64 %144, ptr %118, align 4 - %145 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %"425_1.sroa.10.0.i.i" + %145 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %"421_1.sroa.10.0.i.i" %146 = load i64, ptr %145, align 4 tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %147 = add i64 %"425_1.sroa.10.0.i.i", 1 +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i + %147 = add i64 %"421_1.sroa.10.0.i.i", 1 %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %148 + %149 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i + br i1 %153, label %cond_exit_424.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_428.thread.i.i +__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_424.thread.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 %"425_1.sroa.0.0.i.i", i64 %147 + %156 = getelementptr inbounds i64, ptr %"421_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_428.thread.1.i.i + br label %cond_exit_424.thread.1.i.i -cond_exit_428.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_428.thread.i.i - %158 = add i64 %"425_1.sroa.10.0.i.i", 2 +cond_exit_424.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_424.thread.i.i + %158 = add i64 %"421_1.sroa.10.0.i.i", 2 %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i + br i1 %164, label %cond_exit_424.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_428.thread.1.i.i +__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_424.thread.1.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 %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.2.i.i + br label %cond_exit_424.thread.2.i.i -cond_exit_428.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_428.thread.1.i.i - %169 = add i64 %"425_1.sroa.10.0.i.i", 3 +cond_exit_424.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_424.thread.1.i.i + %169 = add i64 %"421_1.sroa.10.0.i.i", 3 %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %170 + %171 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i + br i1 %175, label %cond_exit_424.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_428.thread.2.i.i +__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_424.thread.2.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 %"425_1.sroa.0.0.i.i", i64 %169 + %178 = getelementptr inbounds i64, ptr %"421_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_428.thread.3.i.i + br label %cond_exit_424.thread.3.i.i -cond_exit_428.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_428.thread.2.i.i - %180 = add i64 %"425_1.sroa.10.0.i.i", 4 +cond_exit_424.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_424.thread.2.i.i + %180 = add i64 %"421_1.sroa.10.0.i.i", 4 %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %181 + %182 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i + br i1 %186, label %cond_exit_424.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_428.thread.3.i.i +__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_424.thread.3.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 %"425_1.sroa.0.0.i.i", i64 %180 + %189 = getelementptr inbounds i64, ptr %"421_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_428.thread.4.i.i + br label %cond_exit_424.thread.4.i.i -cond_exit_428.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_428.thread.3.i.i - %191 = add i64 %"425_1.sroa.10.0.i.i", 5 +cond_exit_424.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_424.thread.3.i.i + %191 = add i64 %"421_1.sroa.10.0.i.i", 5 %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %192 + %193 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i + br i1 %197, label %cond_exit_424.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_428.thread.4.i.i +__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_424.thread.4.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 %"425_1.sroa.0.0.i.i", i64 %191 + %200 = getelementptr inbounds i64, ptr %"421_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_428.thread.5.i.i + br label %cond_exit_424.thread.5.i.i -cond_exit_428.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_428.thread.4.i.i - %202 = add i64 %"425_1.sroa.10.0.i.i", 6 +cond_exit_424.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_424.thread.4.i.i + %202 = add i64 %"421_1.sroa.10.0.i.i", 6 %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %203 + %204 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i + br i1 %208, label %cond_exit_424.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_428.thread.5.i.i +__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_424.thread.5.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 %"425_1.sroa.0.0.i.i", i64 %202 + %211 = getelementptr inbounds i64, ptr %"421_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_428.thread.6.i.i + br label %cond_exit_424.thread.6.i.i -cond_exit_428.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_428.thread.5.i.i - %213 = add i64 %"425_1.sroa.10.0.i.i", 7 +cond_exit_424.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_424.thread.5.i.i + %213 = add i64 %"421_1.sroa.10.0.i.i", 7 %214 = lshr i64 %213, 6 - %215 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %214 + %215 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %214 %216 = load i64, ptr %215, align 4 %217 = and i64 %213, 63 %218 = lshr i64 %216, %217 %219 = trunc i64 %218 to i1 - br i1 %219, label %cond_exit_428.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i + br i1 %219, label %cond_exit_424.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_428.thread.6.i.i +__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_424.thread.6.i.i %220 = shl nuw i64 1, %217 %221 = xor i64 %216, %220 store i64 %221, ptr %215, align 4 - %222 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %213 + %222 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %213 %223 = load i64, ptr %222, align 4 tail call void @___dec_future_refcount(i64 %223) - br label %cond_exit_428.thread.7.i.i + br label %cond_exit_424.thread.7.i.i -cond_exit_428.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_428.thread.6.i.i - %224 = add i64 %"425_1.sroa.10.0.i.i", 8 +cond_exit_424.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_424.thread.6.i.i + %224 = add i64 %"421_1.sroa.10.0.i.i", 8 %225 = lshr i64 %224, 6 - %226 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %225 + %226 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %225 %227 = load i64, ptr %226, align 4 %228 = and i64 %224, 63 %229 = lshr i64 %227, %228 %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_428.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i + br i1 %230, label %cond_exit_424.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_428.thread.7.i.i +__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_424.thread.7.i.i %231 = shl nuw i64 1, %228 %232 = xor i64 %227, %231 store i64 %232, ptr %226, align 4 - %233 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %224 + %233 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %224 %234 = load i64, ptr %233, align 4 tail call void @___dec_future_refcount(i64 %234) - br label %cond_exit_428.thread.8.i.i + br label %cond_exit_424.thread.8.i.i -cond_exit_428.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_428.thread.7.i.i - %235 = add i64 %"425_1.sroa.10.0.i.i", 9 +cond_exit_424.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_424.thread.7.i.i + %235 = add i64 %"421_1.sroa.10.0.i.i", 9 %236 = lshr i64 %235, 6 - %237 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %236 + %237 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %236 %238 = load i64, ptr %237, align 4 %239 = and i64 %235, 63 %240 = lshr i64 %238, %239 %241 = trunc i64 %240 to i1 - br i1 %241, label %cond_exit_428.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i + br i1 %241, label %cond_exit_424.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_428.thread.8.i.i +__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_424.thread.8.i.i %242 = shl nuw i64 1, %239 %243 = xor i64 %238, %242 store i64 %243, ptr %237, align 4 - %244 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %235 + %244 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %235 %245 = load i64, ptr %244, align 4 tail call void @___dec_future_refcount(i64 %245) - br label %cond_exit_428.thread.9.i.i + br label %cond_exit_424.thread.9.i.i -cond_exit_428.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_428.thread.8.i.i +cond_exit_424.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_424.thread.8.i.i %246 = load i64, ptr %118, align 4 %247 = sub nuw nsw i64 64, %120 %248 = lshr i64 -1, %247 @@ -687,9 +687,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %124, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_428.thread.9.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_424.thread.9.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %115) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_helios index 8724ed2d5..f2b5f469f 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.15.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_helios index d5043d180..1d715c2b8 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.40.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.44.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.44.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_helios index 4315ef9f5..1f70f438c 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.38.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.42.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.42.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_helios index 12748e333..90f7fa4f5 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) + %shot.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_helios index 975d940a0..1a40d3132 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_helios @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_604_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_600_case_0.i, label %__barray_check_bounds.exit -cond_604_case_0.i: ; preds = %cond_20_case_1 +cond_600_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"624_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"624_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"624_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"620_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"620_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"620_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_627_case_0.i.i: ; preds = %cond_exit_627.thread.i.i - %85 = lshr i64 %"624_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"624_1.sroa.5.0.i.i", i64 %85 +cond_623_case_0.i.i: ; preds = %cond_exit_623.thread.i.i + %85 = lshr i64 %"620_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"620_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"624_1.sroa.10.0.i.i", 63 + %88 = and i64 %"620_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"624_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"620_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_627_case_0.i.i: ; preds = %cond_exit_627.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_627_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_627_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_623_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_623_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_627.thread.i.i, %loop_body.preheader.i.i - %"624_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_627.thread.i.i ] - %106 = add nuw nsw i64 %"624_0.0239.i.i", 1 - %107 = add i64 %"624_0.0239.i.i", %"624_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_623.thread.i.i, %loop_body.preheader.i.i + %"620_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_623.thread.i.i ] + %106 = add nuw nsw i64 %"620_0.0239.i.i", 1 + %107 = add i64 %"620_0.0239.i.i", %"620_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_627.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_623.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"624_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"620_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_627.thread.i.i + br label %cond_exit_623.thread.i.i -cond_exit_627.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_623.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_627_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_623_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_627_case_0.i.i - tail call void @heap_free(ptr %"624_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"624_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_623_case_0.i.i + tail call void @heap_free(ptr %"620_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"620_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_helios index b4f2f1b5a..33778e1c4 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] +__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i -1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios index 99def9f6c..3b5b2cc70 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_helios @@ -14,9 +14,9 @@ alloca_block: 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_229_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_225_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) @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_225_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) @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_225_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) @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_225_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) @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_225_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) @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_225_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) @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_225_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) @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_225_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) @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_225_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios index 4419a24f9..b9395ee0c 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.36.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_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34) %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_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios index 4b1693296..f7700f247 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_helios @@ -15,9 +15,9 @@ alloca_block: 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_405_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_401_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) @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_401_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) @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_401_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) @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_401_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) @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_401_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) @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_401_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) @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_401_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) @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_401_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) @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_401_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) @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i - %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6 - %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136 +cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i + %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6 + %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136 %138 = load i64, ptr %137, align 4 - %139 = and i64 %"425_1.sroa.10.0.i.i", 63 + %139 = and i64 %"421_1.sroa.10.0.i.i", 63 %140 = sub nuw nsw i64 64, %139 %141 = lshr i64 -1, %140 %142 = icmp eq i64 %139, 0 %143 = select i1 %142, i64 0, i64 %141 %144 = or i64 %138, %143 store i64 %144, ptr %137, align 4 - %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9 + %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9 %145 = lshr i64 %last_valid.i.i.i179, 6 - %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145 + %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145 %147 = load i64, ptr %146, align 4 %148 = and i64 %last_valid.i.i.i179, 63 %149 = shl nsw i64 -2, %148 @@ -474,8 +474,8 @@ cond_428_case_0.i.i: ; preds = %cond_exit_428.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182 -mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183 %155 = load i64, ptr %gep.i.i.i184, align 4 %156 = icmp eq i64 %155, -1 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i - %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] - %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 - %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i + %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] + %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 + %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162 %166 = xor i64 %165, %161 store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios index 0b60b94f0..26cda875b 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.15.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios index 7ac62a610..f2a9f612a 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.40.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.44.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.44.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios index eb1c2747d..e45703d74 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.38.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.42.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.42.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios index f20a49f19..bba6354c9 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) + %shot.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_helios index a4871556e..b460adff0 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_helios @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_604_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_600_case_0.i, label %__barray_check_bounds.exit -cond_604_case_0.i: ; preds = %cond_20_case_1 +cond_600_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"624_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"624_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"624_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"620_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"620_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"620_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_627_case_0.i.i: ; preds = %cond_exit_627.thread.i.i - %85 = lshr i64 %"624_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"624_1.sroa.5.0.i.i", i64 %85 +cond_623_case_0.i.i: ; preds = %cond_exit_623.thread.i.i + %85 = lshr i64 %"620_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"620_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"624_1.sroa.10.0.i.i", 63 + %88 = and i64 %"620_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"624_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"620_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_627_case_0.i.i: ; preds = %cond_exit_627.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_627_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_627_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_623_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_623_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_627.thread.i.i, %loop_body.preheader.i.i - %"624_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_627.thread.i.i ] - %106 = add nuw nsw i64 %"624_0.0239.i.i", 1 - %107 = add i64 %"624_0.0239.i.i", %"624_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_623.thread.i.i, %loop_body.preheader.i.i + %"620_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_623.thread.i.i ] + %106 = add nuw nsw i64 %"620_0.0239.i.i", 1 + %107 = add i64 %"620_0.0239.i.i", %"620_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_627.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_623.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"624_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"620_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_627.thread.i.i + br label %cond_exit_623.thread.i.i -cond_exit_627.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_623.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_627_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_623_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_627_case_0.i.i - tail call void @heap_free(ptr %"624_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"624_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_623_case_0.i.i + tail call void @heap_free(ptr %"620_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"620_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios index 8eae86370..a835a7874 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] +__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i -1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios index 4c9358de7..78b7740fa 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_helios @@ -14,9 +14,9 @@ alloca_block: 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_229_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_225_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) @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_225_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) @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_225_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) @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_225_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) @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_225_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) @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_225_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) @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_225_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) @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_225_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) @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_225_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios index 06718b8c8..09f6057d1 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.36.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_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34) %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_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios index 5f42b80f4..a0fb175f3 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_helios @@ -15,9 +15,9 @@ alloca_block: 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_405_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_401_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) @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_401_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) @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_401_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) @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_401_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) @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_401_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) @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_401_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) @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_401_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) @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_401_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) @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_401_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) @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i - %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6 - %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136 +cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i + %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6 + %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136 %138 = load i64, ptr %137, align 4 - %139 = and i64 %"425_1.sroa.10.0.i.i", 63 + %139 = and i64 %"421_1.sroa.10.0.i.i", 63 %140 = sub nuw nsw i64 64, %139 %141 = lshr i64 -1, %140 %142 = icmp eq i64 %139, 0 %143 = select i1 %142, i64 0, i64 %141 %144 = or i64 %138, %143 store i64 %144, ptr %137, align 4 - %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9 + %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9 %145 = lshr i64 %last_valid.i.i.i179, 6 - %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145 + %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145 %147 = load i64, ptr %146, align 4 %148 = and i64 %last_valid.i.i.i179, 63 %149 = shl nsw i64 -2, %148 @@ -474,8 +474,8 @@ cond_428_case_0.i.i: ; preds = %cond_exit_428.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182 -mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183 %155 = load i64, ptr %gep.i.i.i184, align 4 %156 = icmp eq i64 %155, -1 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i - %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] - %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 - %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i + %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] + %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 + %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162 %166 = xor i64 %165, %161 store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios index da0873232..bba38b92e 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.15.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios index 94cd2e71f..2e1ec69b0 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.40.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.44.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.44.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios index e93b19b01..ebcb4e84c 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.38.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.42.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.42.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios index 700c1e4e4..9bc08ebcc 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) + %shot.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_helios index d8bfa84d4..208997985 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_helios @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_604_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_600_case_0.i, label %__barray_check_bounds.exit -cond_604_case_0.i: ; preds = %cond_20_case_1 +cond_600_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"624_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"624_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"624_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"620_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"620_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"620_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_627_case_0.i.i: ; preds = %cond_exit_627.thread.i.i - %85 = lshr i64 %"624_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"624_1.sroa.5.0.i.i", i64 %85 +cond_623_case_0.i.i: ; preds = %cond_exit_623.thread.i.i + %85 = lshr i64 %"620_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"620_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"624_1.sroa.10.0.i.i", 63 + %88 = and i64 %"620_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"624_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"620_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_627_case_0.i.i: ; preds = %cond_exit_627.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_627_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_627_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_623_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_623_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_627.thread.i.i, %loop_body.preheader.i.i - %"624_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_627.thread.i.i ] - %106 = add nuw nsw i64 %"624_0.0239.i.i", 1 - %107 = add i64 %"624_0.0239.i.i", %"624_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_623.thread.i.i, %loop_body.preheader.i.i + %"620_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_623.thread.i.i ] + %106 = add nuw nsw i64 %"620_0.0239.i.i", 1 + %107 = add i64 %"620_0.0239.i.i", %"620_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_627.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_623.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"624_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"620_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_627.thread.i.i + br label %cond_exit_623.thread.i.i -cond_exit_627.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_623.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_627_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_623_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_627_case_0.i.i - tail call void @heap_free(ptr %"624_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"624_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_623_case_0.i.i + tail call void @heap_free(ptr %"620_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"620_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios index 2af68c73a..904aabb2e 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] +__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i -1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios index df8c7e0f5..1b58e0b9e 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_helios @@ -14,9 +14,9 @@ alloca_block: 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_229_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_225_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) @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_225_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) @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_225_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) @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_225_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) @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_225_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) @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_225_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) @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_225_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) @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_225_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) @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_225_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios index 258cf2626..301c3cff0 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_helios @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_40_case_0.i, label %__hugr__.__tk2_helios_qalloc.36.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.36.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_44_case_0.i36, label %__hugr__.__tk2_helios_qalloc.40.exit37 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_helios_qalloc.36.exit37 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit +__hugr__.__tk2_helios_qalloc.36.exit37: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34) %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_44_case_0.i40, label %__hugr__.__tk2_helios_qalloc.40.exit41 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_helios_qalloc.36.exit41 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit37 +__hugr__.__tk2_helios_qalloc.36.exit41: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rxy(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_helios_qalloc.40.exit45 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_helios_qalloc.36.exit45 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.40.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit41 +__hugr__.__tk2_helios_qalloc.36.exit45: ; preds = %__hugr__.__tk2_helios_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios index 2fbaa2a11..2218b7649 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_helios @@ -15,9 +15,9 @@ alloca_block: 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_405_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_401_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) @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_401_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) @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_401_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) @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_401_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) @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_401_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) @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_401_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) @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_401_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) @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_401_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) @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_401_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) @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i - %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6 - %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136 +cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i + %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6 + %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136 %138 = load i64, ptr %137, align 4 - %139 = and i64 %"425_1.sroa.10.0.i.i", 63 + %139 = and i64 %"421_1.sroa.10.0.i.i", 63 %140 = sub nuw nsw i64 64, %139 %141 = lshr i64 -1, %140 %142 = icmp eq i64 %139, 0 %143 = select i1 %142, i64 0, i64 %141 %144 = or i64 %138, %143 store i64 %144, ptr %137, align 4 - %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9 + %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9 %145 = lshr i64 %last_valid.i.i.i179, 6 - %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145 + %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145 %147 = load i64, ptr %146, align 4 %148 = and i64 %last_valid.i.i.i179, 63 %149 = shl nsw i64 -2, %148 @@ -474,8 +474,8 @@ cond_428_case_0.i.i: ; preds = %cond_exit_428.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182 -mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183 %155 = load i64, ptr %gep.i.i.i184, align 4 %156 = icmp eq i64 %155, -1 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i - %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] - %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 - %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i + %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] + %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 + %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162 %166 = xor i64 %165, %161 store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios index 003c93dd3..226b3219f 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_helios @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_19_case_0.i, label %__hugr__.__tk2_helios_qalloc.15.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.15.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios index 50b211302..966122f7f 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_helios_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_helios_qalloc.40.exit -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.40.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.44.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.44.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios index 60d3ab1f5..b32806379 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_helios @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_helios_qalloc.42.exit + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_helios_qalloc.38.exit -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.38.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.42.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.42.exit +0: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_helios_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_helios_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios index 9a78b61f0..bcf269ecd 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_helios @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) + %shot.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_helios index 3e37e7e04..086679d4f 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_helios @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_604_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_600_case_0.i, label %__barray_check_bounds.exit -cond_604_case_0.i: ; preds = %cond_20_case_1 +cond_600_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"624_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"624_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"624_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"620_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"620_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"620_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_627_case_0.i.i: ; preds = %cond_exit_627.thread.i.i - %85 = lshr i64 %"624_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"624_1.sroa.5.0.i.i", i64 %85 +cond_623_case_0.i.i: ; preds = %cond_exit_623.thread.i.i + %85 = lshr i64 %"620_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"620_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"624_1.sroa.10.0.i.i", 63 + %88 = and i64 %"620_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"624_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"620_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_627_case_0.i.i: ; preds = %cond_exit_627.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_627_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_627_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_623_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_623_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_627.thread.i.i, %loop_body.preheader.i.i - %"624_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_627.thread.i.i ] - %106 = add nuw nsw i64 %"624_0.0239.i.i", 1 - %107 = add i64 %"624_0.0239.i.i", %"624_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_623.thread.i.i, %loop_body.preheader.i.i + %"620_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_623.thread.i.i ] + %106 = add nuw nsw i64 %"620_0.0239.i.i", 1 + %107 = add i64 %"620_0.0239.i.i", %"620_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"624_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"620_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_627.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_623.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"624_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"620_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_627.thread.i.i + br label %cond_exit_623.thread.i.i -cond_exit_627.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_623.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_627_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_623_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_627_case_0.i.i - tail call void @heap_free(ptr %"624_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"624_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_623_case_0.i.i + tail call void @heap_free(ptr %"620_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"620_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios index a70812002..5e2429954 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/helios-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_helios @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_helios_qalloc.98.exit + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_helios_qalloc.94.exit -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_helios_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_helios_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.98.exit ] +__hugr__.__tk2_helios_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_helios_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.98.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_helios_qalloc.94.exit94.i -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit.i +__hugr__.__tk2_helios_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rxy(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_helios_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_heli tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_102_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.98.exit.i + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_helios_qalloc.94.exit.i -1: ; preds = %__hugr__.__tk2_helios_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_helios_qalloc.94.exit94.i tail call void @___rz(i64 %qalloc.i, double 0x3FE921FB54442D18) tail call void @___rz(i64 %qalloc.i, double 0x400921FB54442D18) tail call void @___rxy(i64 %qalloc.i91.i, double 0xBFF921FB54442D18, double 0x3FF921FB54442D18) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol index e19d1bf57..c258f5863 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin_sol @@ -14,157 +14,157 @@ alloca_block: 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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.225.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.221.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.9, %__hugr__.__tk2_sol_qalloc.225.exit.8, %__hugr__.__tk2_sol_qalloc.225.exit.7, %__hugr__.__tk2_sol_qalloc.225.exit.6, %__hugr__.__tk2_sol_qalloc.225.exit.5, %__hugr__.__tk2_sol_qalloc.225.exit.4, %__hugr__.__tk2_sol_qalloc.225.exit.3, %__hugr__.__tk2_sol_qalloc.225.exit.2, %__hugr__.__tk2_sol_qalloc.225.exit.1, %__hugr__.__tk2_sol_qalloc.225.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.221.exit.8, %__hugr__.__tk2_sol_qalloc.221.exit.7, %__hugr__.__tk2_sol_qalloc.221.exit.6, %__hugr__.__tk2_sol_qalloc.221.exit.5, %__hugr__.__tk2_sol_qalloc.221.exit.4, %__hugr__.__tk2_sol_qalloc.221.exit.3, %__hugr__.__tk2_sol_qalloc.221.exit.2, %__hugr__.__tk2_sol_qalloc.221.exit.1, %__hugr__.__tk2_sol_qalloc.221.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit +cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.1 + br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.1 -__hugr__.__tk2_sol_qalloc.225.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.221.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.225.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.2 + br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.2 -__hugr__.__tk2_sol_qalloc.225.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.221.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 %.not117 = icmp eq i64 %10, 0 br i1 %.not117, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.3 + br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.3 -__hugr__.__tk2_sol_qalloc.225.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.221.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 %.not118 = icmp eq i64 %14, 0 br i1 %.not118, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.4 + br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.4 -__hugr__.__tk2_sol_qalloc.225.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.221.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 %.not119 = icmp eq i64 %18, 0 br i1 %.not119, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.5 + br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.5 -__hugr__.__tk2_sol_qalloc.225.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.221.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 %.not120 = icmp eq i64 %22, 0 br i1 %.not120, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.6 + br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.6 -__hugr__.__tk2_sol_qalloc.225.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.221.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 %.not121 = icmp eq i64 %26, 0 br i1 %.not121, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.7 + br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.7 -__hugr__.__tk2_sol_qalloc.225.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.221.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 %.not122 = icmp eq i64 %30, 0 br i1 %.not122, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.8 + br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.8 -__hugr__.__tk2_sol_qalloc.225.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.221.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 %.not123 = icmp eq i64 %34, 0 br i1 %.not123, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_225_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol index 06c0be359..02aca59c0 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-flip_some/flip_some_aarch64-apple-darwin_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.36.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_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34) %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_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol index 8014ccc7f..6a33d1e9d 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-measure_qb_array/measure_qb_array_aarch64-apple-darwin_sol @@ -15,157 +15,157 @@ alloca_block: 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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.378.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.374.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.9, %__hugr__.__tk2_sol_qalloc.378.exit.8, %__hugr__.__tk2_sol_qalloc.378.exit.7, %__hugr__.__tk2_sol_qalloc.378.exit.6, %__hugr__.__tk2_sol_qalloc.378.exit.5, %__hugr__.__tk2_sol_qalloc.378.exit.4, %__hugr__.__tk2_sol_qalloc.378.exit.3, %__hugr__.__tk2_sol_qalloc.378.exit.2, %__hugr__.__tk2_sol_qalloc.378.exit.1, %__hugr__.__tk2_sol_qalloc.378.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.374.exit.8, %__hugr__.__tk2_sol_qalloc.374.exit.7, %__hugr__.__tk2_sol_qalloc.374.exit.6, %__hugr__.__tk2_sol_qalloc.374.exit.5, %__hugr__.__tk2_sol_qalloc.374.exit.4, %__hugr__.__tk2_sol_qalloc.374.exit.3, %__hugr__.__tk2_sol_qalloc.374.exit.2, %__hugr__.__tk2_sol_qalloc.374.exit.1, %__hugr__.__tk2_sol_qalloc.374.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit +cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.1 + br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.1 -__hugr__.__tk2_sol_qalloc.378.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.374.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 %.not199 = icmp eq i64 %6, 0 br i1 %.not199, label %panic.i, label %cond_exit_20.1 -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.2 + br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.2 -__hugr__.__tk2_sol_qalloc.378.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.374.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 %.not200 = icmp eq i64 %10, 0 br i1 %.not200, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.3 + br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.3 -__hugr__.__tk2_sol_qalloc.378.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.374.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 %.not201 = icmp eq i64 %14, 0 br i1 %.not201, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.4 + br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.4 -__hugr__.__tk2_sol_qalloc.378.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.374.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 %.not202 = icmp eq i64 %18, 0 br i1 %.not202, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.5 + br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.5 -__hugr__.__tk2_sol_qalloc.378.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.374.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 %.not203 = icmp eq i64 %22, 0 br i1 %.not203, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.6 + br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.6 -__hugr__.__tk2_sol_qalloc.378.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.374.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 %.not204 = icmp eq i64 %26, 0 br i1 %.not204, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.7 + br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.7 -__hugr__.__tk2_sol_qalloc.378.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.374.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 %.not205 = icmp eq i64 %30, 0 br i1 %.not205, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.8 + br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.8 -__hugr__.__tk2_sol_qalloc.378.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.374.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 %.not206 = icmp eq i64 %34, 0 br i1 %.not206, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_401_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) @@ -399,16 +399,16 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 - %117 = lshr i64 %"425_1.sroa.10.0.i.i", 6 - %118 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %117 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 + %117 = lshr i64 %"421_1.sroa.10.0.i.i", 6 + %118 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %117 %119 = load i64, ptr %118, align 4 - %120 = and i64 %"425_1.sroa.10.0.i.i", 63 + %120 = and i64 %"421_1.sroa.10.0.i.i", 63 %121 = lshr i64 %119, %120 %122 = trunc i64 %121 to i1 - br i1 %122, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %122, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" %123 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" ], [ %265, %loop_body.i177 ] @@ -452,8 +452,8 @@ panic.i222.i.i: ; preds = %__barray_check_boun %exitcond.not.i.i.i185 = icmp eq i64 %.02.i.i.i182, %reass.sub.i.i.i179 br i1 %exitcond.not.i.i.i185, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i181 -mask_block_ok.i.i.i181: ; preds = %cond_exit_428.thread.9.i.i, %139 - %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_428.thread.9.i.i ] +mask_block_ok.i.i.i181: ; preds = %cond_exit_424.thread.9.i.i, %139 + %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_424.thread.9.i.i ] %gep.i.i.i183 = getelementptr i64, ptr %118, i64 %.02.i.i.i182 %141 = load i64, ptr %gep.i.i.i183, align 4 %142 = icmp eq i64 %141, -1 @@ -467,183 +467,183 @@ __barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader %143 = shl nuw i64 1, %120 %144 = xor i64 %119, %143 store i64 %144, ptr %118, align 4 - %145 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %"425_1.sroa.10.0.i.i" + %145 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %"421_1.sroa.10.0.i.i" %146 = load i64, ptr %145, align 4 tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %147 = add i64 %"425_1.sroa.10.0.i.i", 1 +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i + %147 = add i64 %"421_1.sroa.10.0.i.i", 1 %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %148 + %149 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i + br i1 %153, label %cond_exit_424.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_428.thread.i.i +__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_424.thread.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 %"425_1.sroa.0.0.i.i", i64 %147 + %156 = getelementptr inbounds i64, ptr %"421_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_428.thread.1.i.i + br label %cond_exit_424.thread.1.i.i -cond_exit_428.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_428.thread.i.i - %158 = add i64 %"425_1.sroa.10.0.i.i", 2 +cond_exit_424.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_424.thread.i.i + %158 = add i64 %"421_1.sroa.10.0.i.i", 2 %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i + br i1 %164, label %cond_exit_424.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_428.thread.1.i.i +__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_424.thread.1.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 %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.2.i.i + br label %cond_exit_424.thread.2.i.i -cond_exit_428.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_428.thread.1.i.i - %169 = add i64 %"425_1.sroa.10.0.i.i", 3 +cond_exit_424.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_424.thread.1.i.i + %169 = add i64 %"421_1.sroa.10.0.i.i", 3 %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %170 + %171 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i + br i1 %175, label %cond_exit_424.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_428.thread.2.i.i +__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_424.thread.2.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 %"425_1.sroa.0.0.i.i", i64 %169 + %178 = getelementptr inbounds i64, ptr %"421_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_428.thread.3.i.i + br label %cond_exit_424.thread.3.i.i -cond_exit_428.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_428.thread.2.i.i - %180 = add i64 %"425_1.sroa.10.0.i.i", 4 +cond_exit_424.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_424.thread.2.i.i + %180 = add i64 %"421_1.sroa.10.0.i.i", 4 %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %181 + %182 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i + br i1 %186, label %cond_exit_424.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_428.thread.3.i.i +__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_424.thread.3.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 %"425_1.sroa.0.0.i.i", i64 %180 + %189 = getelementptr inbounds i64, ptr %"421_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_428.thread.4.i.i + br label %cond_exit_424.thread.4.i.i -cond_exit_428.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_428.thread.3.i.i - %191 = add i64 %"425_1.sroa.10.0.i.i", 5 +cond_exit_424.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_424.thread.3.i.i + %191 = add i64 %"421_1.sroa.10.0.i.i", 5 %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %192 + %193 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i + br i1 %197, label %cond_exit_424.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_428.thread.4.i.i +__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_424.thread.4.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 %"425_1.sroa.0.0.i.i", i64 %191 + %200 = getelementptr inbounds i64, ptr %"421_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_428.thread.5.i.i + br label %cond_exit_424.thread.5.i.i -cond_exit_428.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_428.thread.4.i.i - %202 = add i64 %"425_1.sroa.10.0.i.i", 6 +cond_exit_424.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_424.thread.4.i.i + %202 = add i64 %"421_1.sroa.10.0.i.i", 6 %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %203 + %204 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i + br i1 %208, label %cond_exit_424.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_428.thread.5.i.i +__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_424.thread.5.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 %"425_1.sroa.0.0.i.i", i64 %202 + %211 = getelementptr inbounds i64, ptr %"421_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_428.thread.6.i.i + br label %cond_exit_424.thread.6.i.i -cond_exit_428.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_428.thread.5.i.i - %213 = add i64 %"425_1.sroa.10.0.i.i", 7 +cond_exit_424.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_424.thread.5.i.i + %213 = add i64 %"421_1.sroa.10.0.i.i", 7 %214 = lshr i64 %213, 6 - %215 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %214 + %215 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %214 %216 = load i64, ptr %215, align 4 %217 = and i64 %213, 63 %218 = lshr i64 %216, %217 %219 = trunc i64 %218 to i1 - br i1 %219, label %cond_exit_428.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i + br i1 %219, label %cond_exit_424.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_428.thread.6.i.i +__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_424.thread.6.i.i %220 = shl nuw i64 1, %217 %221 = xor i64 %216, %220 store i64 %221, ptr %215, align 4 - %222 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %213 + %222 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %213 %223 = load i64, ptr %222, align 4 tail call void @___dec_future_refcount(i64 %223) - br label %cond_exit_428.thread.7.i.i + br label %cond_exit_424.thread.7.i.i -cond_exit_428.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_428.thread.6.i.i - %224 = add i64 %"425_1.sroa.10.0.i.i", 8 +cond_exit_424.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_424.thread.6.i.i + %224 = add i64 %"421_1.sroa.10.0.i.i", 8 %225 = lshr i64 %224, 6 - %226 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %225 + %226 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %225 %227 = load i64, ptr %226, align 4 %228 = and i64 %224, 63 %229 = lshr i64 %227, %228 %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_428.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i + br i1 %230, label %cond_exit_424.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_428.thread.7.i.i +__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_424.thread.7.i.i %231 = shl nuw i64 1, %228 %232 = xor i64 %227, %231 store i64 %232, ptr %226, align 4 - %233 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %224 + %233 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %224 %234 = load i64, ptr %233, align 4 tail call void @___dec_future_refcount(i64 %234) - br label %cond_exit_428.thread.8.i.i + br label %cond_exit_424.thread.8.i.i -cond_exit_428.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_428.thread.7.i.i - %235 = add i64 %"425_1.sroa.10.0.i.i", 9 +cond_exit_424.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_424.thread.7.i.i + %235 = add i64 %"421_1.sroa.10.0.i.i", 9 %236 = lshr i64 %235, 6 - %237 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %236 + %237 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %236 %238 = load i64, ptr %237, align 4 %239 = and i64 %235, 63 %240 = lshr i64 %238, %239 %241 = trunc i64 %240 to i1 - br i1 %241, label %cond_exit_428.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i + br i1 %241, label %cond_exit_424.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_428.thread.8.i.i +__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_424.thread.8.i.i %242 = shl nuw i64 1, %239 %243 = xor i64 %238, %242 store i64 %243, ptr %237, align 4 - %244 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %235 + %244 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %235 %245 = load i64, ptr %244, align 4 tail call void @___dec_future_refcount(i64 %245) - br label %cond_exit_428.thread.9.i.i + br label %cond_exit_424.thread.9.i.i -cond_exit_428.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_428.thread.8.i.i +cond_exit_424.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_424.thread.8.i.i %246 = load i64, ptr %118, align 4 %247 = sub nuw nsw i64 64, %120 %248 = lshr i64 -1, %247 @@ -687,9 +687,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %124, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_428.thread.9.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_424.thread.9.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %115) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol index ef8bf0919..552850cba 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-no_results/no_results_aarch64-apple-darwin_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.15.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol index 8886b03d0..bc1098e4b 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_exit/postselect_exit_aarch64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.40.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.44.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.44.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol index d0b00e579..3b59ef86f 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-postselect_panic/postselect_panic_aarch64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.38.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.42.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.42.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol index 90be7a009..4fed018b2 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-print_current_shot/print_current_shot_aarch64-apple-darwin_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) + %shot.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_sol index 491f8a5f7..e8b4a6b2d 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-qft_32/qft_32_aarch64-apple-darwin_sol @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_616_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_612_case_0.i, label %__barray_check_bounds.exit -cond_616_case_0.i: ; preds = %cond_20_case_1 +cond_612_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"636_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"636_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"636_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"632_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"632_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"632_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_639_case_0.i.i: ; preds = %cond_exit_639.thread.i.i - %85 = lshr i64 %"636_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"636_1.sroa.5.0.i.i", i64 %85 +cond_635_case_0.i.i: ; preds = %cond_exit_635.thread.i.i + %85 = lshr i64 %"632_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"632_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"636_1.sroa.10.0.i.i", 63 + %88 = and i64 %"632_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"636_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"632_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_639_case_0.i.i: ; preds = %cond_exit_639.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_639_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_639_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_635_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_635_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_639.thread.i.i, %loop_body.preheader.i.i - %"636_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_639.thread.i.i ] - %106 = add nuw nsw i64 %"636_0.0239.i.i", 1 - %107 = add i64 %"636_0.0239.i.i", %"636_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_635.thread.i.i, %loop_body.preheader.i.i + %"632_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_635.thread.i.i ] + %106 = add nuw nsw i64 %"632_0.0239.i.i", 1 + %107 = add i64 %"632_0.0239.i.i", %"632_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_639.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_635.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"636_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"632_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_639.thread.i.i + br label %cond_exit_635.thread.i.i -cond_exit_639.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_635.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_639_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_635_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_639_case_0.i.i - tail call void @heap_free(ptr %"636_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"636_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_635_case_0.i.i + tail call void @heap_free(ptr %"632_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"632_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol index 56dc8b57e..5610bb07a 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-apple-darwin-rus/rus_aarch64-apple-darwin_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] +__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i -1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i 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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_sol index 85ba5bbc6..88145546e 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-discard_qb_array/discard_qb_array_aarch64-unknown-linux-gnu_sol @@ -14,157 +14,157 @@ alloca_block: 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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.225.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.221.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.9, %__hugr__.__tk2_sol_qalloc.225.exit.8, %__hugr__.__tk2_sol_qalloc.225.exit.7, %__hugr__.__tk2_sol_qalloc.225.exit.6, %__hugr__.__tk2_sol_qalloc.225.exit.5, %__hugr__.__tk2_sol_qalloc.225.exit.4, %__hugr__.__tk2_sol_qalloc.225.exit.3, %__hugr__.__tk2_sol_qalloc.225.exit.2, %__hugr__.__tk2_sol_qalloc.225.exit.1, %__hugr__.__tk2_sol_qalloc.225.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.221.exit.8, %__hugr__.__tk2_sol_qalloc.221.exit.7, %__hugr__.__tk2_sol_qalloc.221.exit.6, %__hugr__.__tk2_sol_qalloc.221.exit.5, %__hugr__.__tk2_sol_qalloc.221.exit.4, %__hugr__.__tk2_sol_qalloc.221.exit.3, %__hugr__.__tk2_sol_qalloc.221.exit.2, %__hugr__.__tk2_sol_qalloc.221.exit.1, %__hugr__.__tk2_sol_qalloc.221.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit +cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.1 + br i1 %not_max.not.not.i.1, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.1 -__hugr__.__tk2_sol_qalloc.225.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.221.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.225.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.2 + br i1 %not_max.not.not.i.2, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.2 -__hugr__.__tk2_sol_qalloc.225.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.221.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 %.not117 = icmp eq i64 %10, 0 br i1 %.not117, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.3 + br i1 %not_max.not.not.i.3, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.3 -__hugr__.__tk2_sol_qalloc.225.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.221.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 %.not118 = icmp eq i64 %14, 0 br i1 %.not118, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.4 + br i1 %not_max.not.not.i.4, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.4 -__hugr__.__tk2_sol_qalloc.225.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.221.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 %.not119 = icmp eq i64 %18, 0 br i1 %.not119, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.5 + br i1 %not_max.not.not.i.5, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.5 -__hugr__.__tk2_sol_qalloc.225.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.221.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 %.not120 = icmp eq i64 %22, 0 br i1 %.not120, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.6 + br i1 %not_max.not.not.i.6, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.6 -__hugr__.__tk2_sol_qalloc.225.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.221.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 %.not121 = icmp eq i64 %26, 0 br i1 %.not121, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.7 + br i1 %not_max.not.not.i.7, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.7 -__hugr__.__tk2_sol_qalloc.225.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.221.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 %.not122 = icmp eq i64 %30, 0 br i1 %.not122, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__hugr__.__tk2_sol_qalloc.225.exit.8 + br i1 %not_max.not.not.i.8, label %cond_225_case_0.i, label %__hugr__.__tk2_sol_qalloc.221.exit.8 -__hugr__.__tk2_sol_qalloc.225.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.221.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 %.not123 = icmp eq i64 %34, 0 br i1 %.not123, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.225.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.221.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_229_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_225_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_sol index 360d9b5bd..77772a5aa 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-flip_some/flip_some_aarch64-unknown-linux-gnu_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.36.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_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34) %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_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_sol index e3eba2507..365a31eac 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-measure_qb_array/measure_qb_array_aarch64-unknown-linux-gnu_sol @@ -15,157 +15,157 @@ alloca_block: 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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.378.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.374.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.9, %__hugr__.__tk2_sol_qalloc.378.exit.8, %__hugr__.__tk2_sol_qalloc.378.exit.7, %__hugr__.__tk2_sol_qalloc.378.exit.6, %__hugr__.__tk2_sol_qalloc.378.exit.5, %__hugr__.__tk2_sol_qalloc.378.exit.4, %__hugr__.__tk2_sol_qalloc.378.exit.3, %__hugr__.__tk2_sol_qalloc.378.exit.2, %__hugr__.__tk2_sol_qalloc.378.exit.1, %__hugr__.__tk2_sol_qalloc.378.exit +panic.i: ; preds = %__barray_check_bounds.exit.9, %__hugr__.__tk2_sol_qalloc.374.exit.8, %__hugr__.__tk2_sol_qalloc.374.exit.7, %__hugr__.__tk2_sol_qalloc.374.exit.6, %__hugr__.__tk2_sol_qalloc.374.exit.5, %__hugr__.__tk2_sol_qalloc.374.exit.4, %__hugr__.__tk2_sol_qalloc.374.exit.3, %__hugr__.__tk2_sol_qalloc.374.exit.2, %__hugr__.__tk2_sol_qalloc.374.exit.1, %__hugr__.__tk2_sol_qalloc.374.exit tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit +cond_exit_20: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.1 + br i1 %not_max.not.not.i.1, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.1 -__hugr__.__tk2_sol_qalloc.378.exit.1: ; preds = %cond_exit_20 +__hugr__.__tk2_sol_qalloc.374.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 %.not199 = icmp eq i64 %6, 0 br i1 %.not199, label %panic.i, label %cond_exit_20.1 -cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.1 +cond_exit_20.1: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.2 + br i1 %not_max.not.not.i.2, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.2 -__hugr__.__tk2_sol_qalloc.378.exit.2: ; preds = %cond_exit_20.1 +__hugr__.__tk2_sol_qalloc.374.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 %.not200 = icmp eq i64 %10, 0 br i1 %.not200, label %panic.i, label %cond_exit_20.2 -cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.2 +cond_exit_20.2: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.3 + br i1 %not_max.not.not.i.3, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.3 -__hugr__.__tk2_sol_qalloc.378.exit.3: ; preds = %cond_exit_20.2 +__hugr__.__tk2_sol_qalloc.374.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 %.not201 = icmp eq i64 %14, 0 br i1 %.not201, label %panic.i, label %cond_exit_20.3 -cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.3 +cond_exit_20.3: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.4 + br i1 %not_max.not.not.i.4, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.4 -__hugr__.__tk2_sol_qalloc.378.exit.4: ; preds = %cond_exit_20.3 +__hugr__.__tk2_sol_qalloc.374.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 %.not202 = icmp eq i64 %18, 0 br i1 %.not202, label %panic.i, label %cond_exit_20.4 -cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.4 +cond_exit_20.4: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.5 + br i1 %not_max.not.not.i.5, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.5 -__hugr__.__tk2_sol_qalloc.378.exit.5: ; preds = %cond_exit_20.4 +__hugr__.__tk2_sol_qalloc.374.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 %.not203 = icmp eq i64 %22, 0 br i1 %.not203, label %panic.i, label %cond_exit_20.5 -cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.5 +cond_exit_20.5: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.6 + br i1 %not_max.not.not.i.6, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.6 -__hugr__.__tk2_sol_qalloc.378.exit.6: ; preds = %cond_exit_20.5 +__hugr__.__tk2_sol_qalloc.374.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 %.not204 = icmp eq i64 %26, 0 br i1 %.not204, label %panic.i, label %cond_exit_20.6 -cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.6 +cond_exit_20.6: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.7 + br i1 %not_max.not.not.i.7, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.7 -__hugr__.__tk2_sol_qalloc.378.exit.7: ; preds = %cond_exit_20.6 +__hugr__.__tk2_sol_qalloc.374.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 %.not205 = icmp eq i64 %30, 0 br i1 %.not205, label %panic.i, label %cond_exit_20.7 -cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.7 +cond_exit_20.7: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__hugr__.__tk2_sol_qalloc.378.exit.8 + br i1 %not_max.not.not.i.8, label %cond_401_case_0.i, label %__hugr__.__tk2_sol_qalloc.374.exit.8 -__hugr__.__tk2_sol_qalloc.378.exit.8: ; preds = %cond_exit_20.7 +__hugr__.__tk2_sol_qalloc.374.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 %.not206 = icmp eq i64 %34, 0 br i1 %.not206, label %panic.i, label %cond_exit_20.8 -cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.378.exit.8 +cond_exit_20.8: ; preds = %__hugr__.__tk2_sol_qalloc.374.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_405_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_401_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) @@ -399,16 +399,16 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 - %117 = lshr i64 %"425_1.sroa.10.0.i.i", 6 - %118 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %117 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %265, 0 + %117 = lshr i64 %"421_1.sroa.10.0.i.i", 6 + %118 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %117 %119 = load i64, ptr %118, align 4 - %120 = and i64 %"425_1.sroa.10.0.i.i", 63 + %120 = and i64 %"421_1.sroa.10.0.i.i", 63 %121 = lshr i64 %119, %120 %122 = trunc i64 %121 to i1 - br i1 %122, label %cond_exit_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %122, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" %123 = phi { ptr, ptr, i64 } [ %"123.fca.2.insert.i", %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" ], [ %265, %loop_body.i177 ] @@ -452,8 +452,8 @@ panic.i222.i.i: ; preds = %__barray_check_boun %exitcond.not.i.i.i185 = icmp eq i64 %.02.i.i.i182, %reass.sub.i.i.i179 br i1 %exitcond.not.i.i.i185, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i181 -mask_block_ok.i.i.i181: ; preds = %cond_exit_428.thread.9.i.i, %139 - %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_428.thread.9.i.i ] +mask_block_ok.i.i.i181: ; preds = %cond_exit_424.thread.9.i.i, %139 + %.02.i.i.i182 = phi i64 [ %140, %139 ], [ 0, %cond_exit_424.thread.9.i.i ] %gep.i.i.i183 = getelementptr i64, ptr %118, i64 %.02.i.i.i182 %141 = load i64, ptr %gep.i.i.i183, align 4 %142 = icmp eq i64 %141, -1 @@ -467,183 +467,183 @@ __barray_mask_borrow.exit228.i.i: ; preds = %loop_body.preheader %143 = shl nuw i64 1, %120 %144 = xor i64 %119, %143 store i64 %144, ptr %118, align 4 - %145 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %"425_1.sroa.10.0.i.i" + %145 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %"421_1.sroa.10.0.i.i" %146 = load i64, ptr %145, align 4 tail call void @___dec_future_refcount(i64 %146) - br label %cond_exit_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i - %147 = add i64 %"425_1.sroa.10.0.i.i", 1 +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %loop_body.preheader.i.i + %147 = add i64 %"421_1.sroa.10.0.i.i", 1 %148 = lshr i64 %147, 6 - %149 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %148 + %149 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i + br i1 %153, label %cond_exit_424.thread.1.i.i, label %__barray_mask_borrow.exit228.1.i.i -__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_428.thread.i.i +__barray_mask_borrow.exit228.1.i.i: ; preds = %cond_exit_424.thread.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 %"425_1.sroa.0.0.i.i", i64 %147 + %156 = getelementptr inbounds i64, ptr %"421_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_428.thread.1.i.i + br label %cond_exit_424.thread.1.i.i -cond_exit_428.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_428.thread.i.i - %158 = add i64 %"425_1.sroa.10.0.i.i", 2 +cond_exit_424.thread.1.i.i: ; preds = %__barray_mask_borrow.exit228.1.i.i, %cond_exit_424.thread.i.i + %158 = add i64 %"421_1.sroa.10.0.i.i", 2 %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i + br i1 %164, label %cond_exit_424.thread.2.i.i, label %__barray_mask_borrow.exit228.2.i.i -__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_428.thread.1.i.i +__barray_mask_borrow.exit228.2.i.i: ; preds = %cond_exit_424.thread.1.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 %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.2.i.i + br label %cond_exit_424.thread.2.i.i -cond_exit_428.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_428.thread.1.i.i - %169 = add i64 %"425_1.sroa.10.0.i.i", 3 +cond_exit_424.thread.2.i.i: ; preds = %__barray_mask_borrow.exit228.2.i.i, %cond_exit_424.thread.1.i.i + %169 = add i64 %"421_1.sroa.10.0.i.i", 3 %170 = lshr i64 %169, 6 - %171 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %170 + %171 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i + br i1 %175, label %cond_exit_424.thread.3.i.i, label %__barray_mask_borrow.exit228.3.i.i -__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_428.thread.2.i.i +__barray_mask_borrow.exit228.3.i.i: ; preds = %cond_exit_424.thread.2.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 %"425_1.sroa.0.0.i.i", i64 %169 + %178 = getelementptr inbounds i64, ptr %"421_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_428.thread.3.i.i + br label %cond_exit_424.thread.3.i.i -cond_exit_428.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_428.thread.2.i.i - %180 = add i64 %"425_1.sroa.10.0.i.i", 4 +cond_exit_424.thread.3.i.i: ; preds = %__barray_mask_borrow.exit228.3.i.i, %cond_exit_424.thread.2.i.i + %180 = add i64 %"421_1.sroa.10.0.i.i", 4 %181 = lshr i64 %180, 6 - %182 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %181 + %182 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i + br i1 %186, label %cond_exit_424.thread.4.i.i, label %__barray_mask_borrow.exit228.4.i.i -__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_428.thread.3.i.i +__barray_mask_borrow.exit228.4.i.i: ; preds = %cond_exit_424.thread.3.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 %"425_1.sroa.0.0.i.i", i64 %180 + %189 = getelementptr inbounds i64, ptr %"421_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_428.thread.4.i.i + br label %cond_exit_424.thread.4.i.i -cond_exit_428.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_428.thread.3.i.i - %191 = add i64 %"425_1.sroa.10.0.i.i", 5 +cond_exit_424.thread.4.i.i: ; preds = %__barray_mask_borrow.exit228.4.i.i, %cond_exit_424.thread.3.i.i + %191 = add i64 %"421_1.sroa.10.0.i.i", 5 %192 = lshr i64 %191, 6 - %193 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %192 + %193 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i + br i1 %197, label %cond_exit_424.thread.5.i.i, label %__barray_mask_borrow.exit228.5.i.i -__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_428.thread.4.i.i +__barray_mask_borrow.exit228.5.i.i: ; preds = %cond_exit_424.thread.4.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 %"425_1.sroa.0.0.i.i", i64 %191 + %200 = getelementptr inbounds i64, ptr %"421_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_428.thread.5.i.i + br label %cond_exit_424.thread.5.i.i -cond_exit_428.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_428.thread.4.i.i - %202 = add i64 %"425_1.sroa.10.0.i.i", 6 +cond_exit_424.thread.5.i.i: ; preds = %__barray_mask_borrow.exit228.5.i.i, %cond_exit_424.thread.4.i.i + %202 = add i64 %"421_1.sroa.10.0.i.i", 6 %203 = lshr i64 %202, 6 - %204 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %203 + %204 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i + br i1 %208, label %cond_exit_424.thread.6.i.i, label %__barray_mask_borrow.exit228.6.i.i -__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_428.thread.5.i.i +__barray_mask_borrow.exit228.6.i.i: ; preds = %cond_exit_424.thread.5.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 %"425_1.sroa.0.0.i.i", i64 %202 + %211 = getelementptr inbounds i64, ptr %"421_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_428.thread.6.i.i + br label %cond_exit_424.thread.6.i.i -cond_exit_428.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_428.thread.5.i.i - %213 = add i64 %"425_1.sroa.10.0.i.i", 7 +cond_exit_424.thread.6.i.i: ; preds = %__barray_mask_borrow.exit228.6.i.i, %cond_exit_424.thread.5.i.i + %213 = add i64 %"421_1.sroa.10.0.i.i", 7 %214 = lshr i64 %213, 6 - %215 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %214 + %215 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %214 %216 = load i64, ptr %215, align 4 %217 = and i64 %213, 63 %218 = lshr i64 %216, %217 %219 = trunc i64 %218 to i1 - br i1 %219, label %cond_exit_428.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i + br i1 %219, label %cond_exit_424.thread.7.i.i, label %__barray_mask_borrow.exit228.7.i.i -__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_428.thread.6.i.i +__barray_mask_borrow.exit228.7.i.i: ; preds = %cond_exit_424.thread.6.i.i %220 = shl nuw i64 1, %217 %221 = xor i64 %216, %220 store i64 %221, ptr %215, align 4 - %222 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %213 + %222 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %213 %223 = load i64, ptr %222, align 4 tail call void @___dec_future_refcount(i64 %223) - br label %cond_exit_428.thread.7.i.i + br label %cond_exit_424.thread.7.i.i -cond_exit_428.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_428.thread.6.i.i - %224 = add i64 %"425_1.sroa.10.0.i.i", 8 +cond_exit_424.thread.7.i.i: ; preds = %__barray_mask_borrow.exit228.7.i.i, %cond_exit_424.thread.6.i.i + %224 = add i64 %"421_1.sroa.10.0.i.i", 8 %225 = lshr i64 %224, 6 - %226 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %225 + %226 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %225 %227 = load i64, ptr %226, align 4 %228 = and i64 %224, 63 %229 = lshr i64 %227, %228 %230 = trunc i64 %229 to i1 - br i1 %230, label %cond_exit_428.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i + br i1 %230, label %cond_exit_424.thread.8.i.i, label %__barray_mask_borrow.exit228.8.i.i -__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_428.thread.7.i.i +__barray_mask_borrow.exit228.8.i.i: ; preds = %cond_exit_424.thread.7.i.i %231 = shl nuw i64 1, %228 %232 = xor i64 %227, %231 store i64 %232, ptr %226, align 4 - %233 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %224 + %233 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %224 %234 = load i64, ptr %233, align 4 tail call void @___dec_future_refcount(i64 %234) - br label %cond_exit_428.thread.8.i.i + br label %cond_exit_424.thread.8.i.i -cond_exit_428.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_428.thread.7.i.i - %235 = add i64 %"425_1.sroa.10.0.i.i", 9 +cond_exit_424.thread.8.i.i: ; preds = %__barray_mask_borrow.exit228.8.i.i, %cond_exit_424.thread.7.i.i + %235 = add i64 %"421_1.sroa.10.0.i.i", 9 %236 = lshr i64 %235, 6 - %237 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %236 + %237 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %236 %238 = load i64, ptr %237, align 4 %239 = and i64 %235, 63 %240 = lshr i64 %238, %239 %241 = trunc i64 %240 to i1 - br i1 %241, label %cond_exit_428.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i + br i1 %241, label %cond_exit_424.thread.9.i.i, label %__barray_mask_borrow.exit228.9.i.i -__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_428.thread.8.i.i +__barray_mask_borrow.exit228.9.i.i: ; preds = %cond_exit_424.thread.8.i.i %242 = shl nuw i64 1, %239 %243 = xor i64 %238, %242 store i64 %243, ptr %237, align 4 - %244 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %235 + %244 = getelementptr inbounds i64, ptr %"421_1.sroa.0.0.i.i", i64 %235 %245 = load i64, ptr %244, align 4 tail call void @___dec_future_refcount(i64 %245) - br label %cond_exit_428.thread.9.i.i + br label %cond_exit_424.thread.9.i.i -cond_exit_428.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_428.thread.8.i.i +cond_exit_424.thread.9.i.i: ; preds = %__barray_mask_borrow.exit228.9.i.i, %cond_exit_424.thread.8.i.i %246 = load i64, ptr %118, align 4 %247 = sub nuw nsw i64 64, %120 %248 = lshr i64 -1, %247 @@ -687,9 +687,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %124, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_428.thread.9.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %139, %cond_exit_424.thread.9.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %115) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_sol index 1e83f5863..d8e6084f8 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-no_results/no_results_aarch64-unknown-linux-gnu_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.15.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_sol index 97cc5111e..ef2f3e32f 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_exit/postselect_exit_aarch64-unknown-linux-gnu_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.40.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.44.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.44.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_sol index cae7d8052..106dc11ef 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-postselect_panic/postselect_panic_aarch64-unknown-linux-gnu_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.38.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.42.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.42.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_sol index 12748e333..90f7fa4f5 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-print_current_shot/print_current_shot_aarch64-unknown-linux-gnu_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) + %shot.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_sol index 201f54165..07ed8b403 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-qft_32/qft_32_aarch64-unknown-linux-gnu_sol @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_616_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_612_case_0.i, label %__barray_check_bounds.exit -cond_616_case_0.i: ; preds = %cond_20_case_1 +cond_612_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"636_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"636_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"636_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"632_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"632_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"632_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_639_case_0.i.i: ; preds = %cond_exit_639.thread.i.i - %85 = lshr i64 %"636_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"636_1.sroa.5.0.i.i", i64 %85 +cond_635_case_0.i.i: ; preds = %cond_exit_635.thread.i.i + %85 = lshr i64 %"632_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"632_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"636_1.sroa.10.0.i.i", 63 + %88 = and i64 %"632_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"636_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"632_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_639_case_0.i.i: ; preds = %cond_exit_639.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_639_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_639_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_635_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_635_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_639.thread.i.i, %loop_body.preheader.i.i - %"636_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_639.thread.i.i ] - %106 = add nuw nsw i64 %"636_0.0239.i.i", 1 - %107 = add i64 %"636_0.0239.i.i", %"636_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_635.thread.i.i, %loop_body.preheader.i.i + %"632_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_635.thread.i.i ] + %106 = add nuw nsw i64 %"632_0.0239.i.i", 1 + %107 = add i64 %"632_0.0239.i.i", %"632_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_639.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_635.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"636_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"632_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_639.thread.i.i + br label %cond_exit_635.thread.i.i -cond_exit_639.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_635.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_639_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_635_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_639_case_0.i.i - tail call void @heap_free(ptr %"636_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"636_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_635_case_0.i.i + tail call void @heap_free(ptr %"632_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"632_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_sol index 01b048936..fe1402ee5 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-aarch64-unknown-linux-gnu-rus/rus_aarch64-unknown-linux-gnu_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] +__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i -1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i 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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol index 99def9f6c..3b5b2cc70 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-discard_qb_array/discard_qb_array_x86_64-apple-darwin_sol @@ -14,9 +14,9 @@ alloca_block: 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_229_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_225_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) @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_225_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) @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_225_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) @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_225_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) @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_225_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) @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_225_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) @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_225_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) @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_225_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) @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_225_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol index e1a7f5bf4..a1b0bb61c 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-flip_some/flip_some_x86_64-apple-darwin_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.36.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_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34) %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_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol index 3e9a7dd1a..5b3644359 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-measure_qb_array/measure_qb_array_x86_64-apple-darwin_sol @@ -15,9 +15,9 @@ alloca_block: 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_405_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_401_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) @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_401_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) @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_401_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) @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_401_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) @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_401_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) @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_401_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) @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_401_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) @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_401_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) @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_401_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) @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i - %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6 - %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136 +cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i + %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6 + %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136 %138 = load i64, ptr %137, align 4 - %139 = and i64 %"425_1.sroa.10.0.i.i", 63 + %139 = and i64 %"421_1.sroa.10.0.i.i", 63 %140 = sub nuw nsw i64 64, %139 %141 = lshr i64 -1, %140 %142 = icmp eq i64 %139, 0 %143 = select i1 %142, i64 0, i64 %141 %144 = or i64 %138, %143 store i64 %144, ptr %137, align 4 - %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9 + %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9 %145 = lshr i64 %last_valid.i.i.i179, 6 - %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145 + %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145 %147 = load i64, ptr %146, align 4 %148 = and i64 %last_valid.i.i.i179, 63 %149 = shl nsw i64 -2, %148 @@ -474,8 +474,8 @@ cond_428_case_0.i.i: ; preds = %cond_exit_428.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182 -mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183 %155 = load i64, ptr %gep.i.i.i184, align 4 %156 = icmp eq i64 %155, -1 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i - %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] - %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 - %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i + %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] + %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 + %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162 %166 = xor i64 %165, %161 store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol index 879445190..6de83ec6f 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-no_results/no_results_x86_64-apple-darwin_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.15.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol index fcd8f5c0f..c89fcd98b 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_exit/postselect_exit_x86_64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.40.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.44.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.44.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol index aa7560b7e..13e74f52d 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-postselect_panic/postselect_panic_x86_64-apple-darwin_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.38.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.42.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.42.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol index f20a49f19..bba6354c9 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-print_current_shot/print_current_shot_x86_64-apple-darwin_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) + %shot.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_sol index 65051e56e..75f389eba 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-qft_32/qft_32_x86_64-apple-darwin_sol @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_616_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_612_case_0.i, label %__barray_check_bounds.exit -cond_616_case_0.i: ; preds = %cond_20_case_1 +cond_612_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"636_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"636_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"636_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"632_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"632_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"632_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_639_case_0.i.i: ; preds = %cond_exit_639.thread.i.i - %85 = lshr i64 %"636_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"636_1.sroa.5.0.i.i", i64 %85 +cond_635_case_0.i.i: ; preds = %cond_exit_635.thread.i.i + %85 = lshr i64 %"632_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"632_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"636_1.sroa.10.0.i.i", 63 + %88 = and i64 %"632_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"636_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"632_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_639_case_0.i.i: ; preds = %cond_exit_639.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_639_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_639_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_635_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_635_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_639.thread.i.i, %loop_body.preheader.i.i - %"636_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_639.thread.i.i ] - %106 = add nuw nsw i64 %"636_0.0239.i.i", 1 - %107 = add i64 %"636_0.0239.i.i", %"636_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_635.thread.i.i, %loop_body.preheader.i.i + %"632_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_635.thread.i.i ] + %106 = add nuw nsw i64 %"632_0.0239.i.i", 1 + %107 = add i64 %"632_0.0239.i.i", %"632_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_639.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_635.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"636_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"632_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_639.thread.i.i + br label %cond_exit_635.thread.i.i -cond_exit_639.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_635.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_639_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_635_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_639_case_0.i.i - tail call void @heap_free(ptr %"636_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"636_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_635_case_0.i.i + tail call void @heap_free(ptr %"632_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"632_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol index 2c1aecd37..896e03ca1 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-apple-darwin-rus/rus_x86_64-apple-darwin_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] +__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i -1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i 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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol index 4c9358de7..78b7740fa 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-discard_qb_array/discard_qb_array_x86_64-unknown-linux-gnu_sol @@ -14,9 +14,9 @@ alloca_block: 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_229_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_225_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) @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_225_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) @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_225_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) @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_225_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) @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_225_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) @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_225_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) @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_225_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) @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_225_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) @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_225_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol index 7da5f88ab..531c19c86 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-flip_some/flip_some_x86_64-unknown-linux-gnu_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.36.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_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34) %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_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol index 743892385..c07f172aa 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-measure_qb_array/measure_qb_array_x86_64-unknown-linux-gnu_sol @@ -15,9 +15,9 @@ alloca_block: 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_405_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_401_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) @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_401_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) @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_401_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) @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_401_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) @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_401_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) @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_401_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) @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_401_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) @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_401_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) @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_401_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) @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i - %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6 - %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136 +cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i + %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6 + %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136 %138 = load i64, ptr %137, align 4 - %139 = and i64 %"425_1.sroa.10.0.i.i", 63 + %139 = and i64 %"421_1.sroa.10.0.i.i", 63 %140 = sub nuw nsw i64 64, %139 %141 = lshr i64 -1, %140 %142 = icmp eq i64 %139, 0 %143 = select i1 %142, i64 0, i64 %141 %144 = or i64 %138, %143 store i64 %144, ptr %137, align 4 - %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9 + %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9 %145 = lshr i64 %last_valid.i.i.i179, 6 - %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145 + %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145 %147 = load i64, ptr %146, align 4 %148 = and i64 %last_valid.i.i.i179, 63 %149 = shl nsw i64 -2, %148 @@ -474,8 +474,8 @@ cond_428_case_0.i.i: ; preds = %cond_exit_428.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182 -mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183 %155 = load i64, ptr %gep.i.i.i184, align 4 %156 = icmp eq i64 %155, -1 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i - %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] - %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 - %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i + %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] + %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 + %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162 %166 = xor i64 %165, %161 store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol index 870baee0c..b9822ee11 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-no_results/no_results_x86_64-unknown-linux-gnu_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.15.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol index b3b2fad03..fa7e16a6f 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_exit/postselect_exit_x86_64-unknown-linux-gnu_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.40.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.44.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.44.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol index eac4bf7a9..847095620 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-postselect_panic/postselect_panic_x86_64-unknown-linux-gnu_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.38.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.42.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.42.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol index 700c1e4e4..9bc08ebcc 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-print_current_shot/print_current_shot_x86_64-unknown-linux-gnu_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) + %shot.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_sol index a010a81b5..9cfe7a393 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-qft_32/qft_32_x86_64-unknown-linux-gnu_sol @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_616_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_612_case_0.i, label %__barray_check_bounds.exit -cond_616_case_0.i: ; preds = %cond_20_case_1 +cond_612_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"636_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"636_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"636_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"632_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"632_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"632_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_639_case_0.i.i: ; preds = %cond_exit_639.thread.i.i - %85 = lshr i64 %"636_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"636_1.sroa.5.0.i.i", i64 %85 +cond_635_case_0.i.i: ; preds = %cond_exit_635.thread.i.i + %85 = lshr i64 %"632_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"632_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"636_1.sroa.10.0.i.i", 63 + %88 = and i64 %"632_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"636_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"632_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_639_case_0.i.i: ; preds = %cond_exit_639.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_639_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_639_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_635_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_635_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_639.thread.i.i, %loop_body.preheader.i.i - %"636_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_639.thread.i.i ] - %106 = add nuw nsw i64 %"636_0.0239.i.i", 1 - %107 = add i64 %"636_0.0239.i.i", %"636_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_635.thread.i.i, %loop_body.preheader.i.i + %"632_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_635.thread.i.i ] + %106 = add nuw nsw i64 %"632_0.0239.i.i", 1 + %107 = add i64 %"632_0.0239.i.i", %"632_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_639.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_635.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"636_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"632_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_639.thread.i.i + br label %cond_exit_635.thread.i.i -cond_exit_639.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_635.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_639_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_635_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_639_case_0.i.i - tail call void @heap_free(ptr %"636_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"636_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_635_case_0.i.i + tail call void @heap_free(ptr %"632_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"632_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol index 988f26cc9..7aa63a827 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-unknown-linux-gnu-rus/rus_x86_64-unknown-linux-gnu_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] +__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i -1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i 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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol index df8c7e0f5..1b58e0b9e 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-discard_qb_array/discard_qb_array_x86_64-windows-msvc_sol @@ -14,9 +14,9 @@ alloca_block: 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_229_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_225_case_0.i, label %__barray_check_bounds.exit -cond_229_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_225_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -36,7 +36,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_225_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) @@ -52,7 +52,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_225_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) @@ -68,7 +68,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_225_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) @@ -84,7 +84,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_225_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) @@ -100,7 +100,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_225_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) @@ -116,7 +116,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_225_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) @@ -132,7 +132,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_225_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) @@ -148,7 +148,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_225_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) @@ -164,7 +164,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_229_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_225_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) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol index 2fe5ef2cd..16414654a 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-flip_some/flip_some_x86_64-windows-msvc_sol @@ -13,45 +13,45 @@ define void @"__hugr__.__main__.flip_some..main.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_40_case_0.i, label %__hugr__.__tk2_sol_qalloc.36.exit -cond_44_case_0.i: ; preds = %alloca_block +cond_40_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.36.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_44_case_0.i36, label %__hugr__.__tk2_sol_qalloc.40.exit37 + br i1 %not_max.not.not.i35, label %cond_40_case_0.i36, label %__hugr__.__tk2_sol_qalloc.36.exit37 -cond_44_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +cond_40_case_0.i36: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit +__hugr__.__tk2_sol_qalloc.36.exit37: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit tail call void @___reset(i64 %qalloc.i34) %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_44_case_0.i40, label %__hugr__.__tk2_sol_qalloc.40.exit41 + br i1 %not_max.not.not.i39, label %cond_40_case_0.i40, label %__hugr__.__tk2_sol_qalloc.36.exit41 -cond_44_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +cond_40_case_0.i40: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit37 +__hugr__.__tk2_sol_qalloc.36.exit41: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit37 tail call void @___reset(i64 %qalloc.i38) tail call void @___rp(i64 %qalloc.i38, double 0x400921FB54442D18, double 0.000000e+00) %qalloc.i42 = tail call i64 @___qalloc() %not_max.not.not.i43 = icmp eq i64 %qalloc.i42, -1 - br i1 %not_max.not.not.i43, label %cond_44_case_0.i44, label %__hugr__.__tk2_sol_qalloc.40.exit45 + br i1 %not_max.not.not.i43, label %cond_40_case_0.i44, label %__hugr__.__tk2_sol_qalloc.36.exit45 -cond_44_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +cond_40_case_0.i44: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.40.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit41 +__hugr__.__tk2_sol_qalloc.36.exit45: ; preds = %__hugr__.__tk2_sol_qalloc.36.exit41 tail call void @___reset(i64 %qalloc.i42) %lazy_measure = tail call i64 @___lazy_measure(i64 %qalloc.i) tail call void @___qfree(i64 %qalloc.i) diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol index d87ad3f76..e2c582ac2 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-measure_qb_array/measure_qb_array_x86_64-windows-msvc_sol @@ -15,9 +15,9 @@ alloca_block: 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_405_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_401_case_0.i, label %__barray_check_bounds.exit -cond_405_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_401_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 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -37,7 +37,7 @@ cond_exit_20: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.1 + br i1 %not_max.not.not.i.1, label %cond_401_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) @@ -53,7 +53,7 @@ cond_exit_20.1: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.2 + br i1 %not_max.not.not.i.2, label %cond_401_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) @@ -69,7 +69,7 @@ cond_exit_20.2: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.3 + br i1 %not_max.not.not.i.3, label %cond_401_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) @@ -85,7 +85,7 @@ cond_exit_20.3: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.4 + br i1 %not_max.not.not.i.4, label %cond_401_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) @@ -101,7 +101,7 @@ cond_exit_20.4: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.5 + br i1 %not_max.not.not.i.5, label %cond_401_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) @@ -117,7 +117,7 @@ cond_exit_20.5: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.6 + br i1 %not_max.not.not.i.6, label %cond_401_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) @@ -133,7 +133,7 @@ cond_exit_20.6: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.7 + br i1 %not_max.not.not.i.7, label %cond_401_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) @@ -149,7 +149,7 @@ cond_exit_20.7: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.8 + br i1 %not_max.not.not.i.8, label %cond_401_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) @@ -165,7 +165,7 @@ cond_exit_20.8: ; preds = %__barray_check_boun 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_405_case_0.i, label %__barray_check_bounds.exit.9 + br i1 %not_max.not.not.i.9, label %cond_401_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) @@ -402,9 +402,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i174 loop_body.preheader.i.i: ; preds = %loop_body.i177 - %"425_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 - %"425_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 - %"425_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 + %"421_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 2 + %"421_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 1 + %"421_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %177, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i174: ; preds = %loop_body.i177, %"__hugr__.guppylang.std.quantum.measure_array$10.186.exit" @@ -444,20 +444,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_428_case_0.i.i: ; preds = %cond_exit_428.thread.i.i - %136 = lshr i64 %"425_1.sroa.10.0.i.i", 6 - %137 = getelementptr i64, ptr %"425_1.sroa.5.0.i.i", i64 %136 +cond_424_case_0.i.i: ; preds = %cond_exit_424.thread.i.i + %136 = lshr i64 %"421_1.sroa.10.0.i.i", 6 + %137 = getelementptr i64, ptr %"421_1.sroa.5.0.i.i", i64 %136 %138 = load i64, ptr %137, align 4 - %139 = and i64 %"425_1.sroa.10.0.i.i", 63 + %139 = and i64 %"421_1.sroa.10.0.i.i", 63 %140 = sub nuw nsw i64 64, %139 %141 = lshr i64 -1, %140 %142 = icmp eq i64 %139, 0 %143 = select i1 %142, i64 0, i64 %141 %144 = or i64 %138, %143 store i64 %144, ptr %137, align 4 - %last_valid.i.i.i179 = add i64 %"425_1.sroa.10.0.i.i", 9 + %last_valid.i.i.i179 = add i64 %"421_1.sroa.10.0.i.i", 9 %145 = lshr i64 %last_valid.i.i.i179, 6 - %146 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %145 + %146 = getelementptr inbounds nuw i64, ptr %"421_1.sroa.5.0.i.i", i64 %145 %147 = load i64, ptr %146, align 4 %148 = and i64 %last_valid.i.i.i179, 63 %149 = shl nsw i64 -2, %148 @@ -474,8 +474,8 @@ cond_428_case_0.i.i: ; preds = %cond_exit_428.threa %exitcond.not.i.i.i186 = icmp eq i64 %.02.i.i.i183, %reass.sub.i.i.i180 br i1 %exitcond.not.i.i.i186, label %"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit", label %mask_block_ok.i.i.i182 -mask_block_ok.i.i.i182: ; preds = %cond_428_case_0.i.i, %153 - %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_428_case_0.i.i ] +mask_block_ok.i.i.i182: ; preds = %cond_424_case_0.i.i, %153 + %.02.i.i.i183 = phi i64 [ %154, %153 ], [ 0, %cond_424_case_0.i.i ] %gep.i.i.i184 = getelementptr i64, ptr %137, i64 %.02.i.i.i183 %155 = load i64, ptr %gep.i.i.i184, align 4 %156 = icmp eq i64 %155, -1 @@ -485,30 +485,30 @@ mask_block_err.i.i.i185: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_428.thread.i.i, %loop_body.preheader.i.i - %"425_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_428.thread.i.i ] - %157 = add nuw nsw i64 %"425_0.0239.i.i", 1 - %158 = add i64 %"425_0.0239.i.i", %"425_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_424.thread.i.i, %loop_body.preheader.i.i + %"421_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %157, %cond_exit_424.thread.i.i ] + %157 = add nuw nsw i64 %"421_0.0239.i.i", 1 + %158 = add i64 %"421_0.0239.i.i", %"421_1.sroa.10.0.i.i" %159 = lshr i64 %158, 6 - %160 = getelementptr inbounds nuw i64, ptr %"425_1.sroa.5.0.i.i", i64 %159 + %160 = getelementptr inbounds nuw i64, ptr %"421_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_428.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %164, label %cond_exit_424.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %165 = shl nuw i64 1, %162 %166 = xor i64 %165, %161 store i64 %166, ptr %160, align 4 - %167 = getelementptr inbounds i64, ptr %"425_1.sroa.0.0.i.i", i64 %158 + %167 = getelementptr inbounds i64, ptr %"421_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_428.thread.i.i + br label %cond_exit_424.thread.i.i -cond_exit_428.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_424.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %157, 10 - br i1 %exitcond.i.i, label %cond_428_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_424_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i175: ; preds = %__barray_check_bounds.exit221.i.i %169 = xor i64 %133, %129 @@ -536,9 +536,9 @@ loop_body.i177: ; preds = %__barray_check_boun %exitcond.not.i178 = icmp eq i64 %121, 10 br i1 %exitcond.not.i178, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i174 -"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_428_case_0.i.i - tail call void @heap_free(ptr %"425_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"425_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$10.145.exit": ; preds = %153, %cond_424_case_0.i.i + tail call void @heap_free(ptr %"421_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"421_1.sroa.5.0.i.i") tail call void @heap_free(ptr %118) ret void } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol index 9cd91238d..a49fae3d9 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-no_results/no_results_x86_64-windows-msvc_sol @@ -9,13 +9,13 @@ define void @"__hugr__.__main__.no_results..bar.1"() local_unnamed_addr alloca_block: %qalloc.i = 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_19_case_0.i, label %__hugr__.__tk2_sol_qalloc.15.exit -cond_23_case_0.i: ; preds = %alloca_block +cond_19_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.15.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/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol index aef5ac70b..7f7fe3d4f 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_exit/postselect_exit_x86_64-windows-msvc_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_exit..main.1"() local_unnamed alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_48_case_0.i, label %__hugr__.__tk2_sol_qalloc.44.exit + br i1 %not_max.not.not.i, label %cond_44_case_0.i, label %__hugr__.__tk2_sol_qalloc.40.exit -cond_48_case_0.i: ; preds = %alloca_block +cond_44_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.44.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.40.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.44.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.44.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.44.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.40.exit tail call void @panic(i32 42, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol index a6737c011..676c49920 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-postselect_panic/postselect_panic_x86_64-windows-msvc_sol @@ -11,13 +11,13 @@ define void @"__hugr__.__main__.postselect_panic..main.1"() local_unname alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_46_case_0.i, label %__hugr__.__tk2_sol_qalloc.42.exit + br i1 %not_max.not.not.i, label %cond_42_case_0.i, label %__hugr__.__tk2_sol_qalloc.38.exit -cond_46_case_0.i: ; preds = %alloca_block +cond_42_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.42.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.38.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.42.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.42.exit +0: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @print_bool(ptr nonnull @res_c.1C9EF4D1.0, i64 11, i1 false) ret void -1: ; preds = %__hugr__.__tk2_sol_qalloc.42.exit +1: ; preds = %__hugr__.__tk2_sol_qalloc.38.exit tail call void @panic(i32 1001, ptr nonnull @s_Postselect.13DF1CD0.0) unreachable } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol index 9a78b61f0..bcf269ecd 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-print_current_shot/print_current_shot_x86_64-windows-msvc_sol @@ -19,8 +19,8 @@ declare void @print_int(ptr, i64, i64) local_unnamed_addr define i64 @qmain(i64 %0) local_unnamed_addr { entry: tail call void @setup(i64 %0) - %shot.i.i = tail call i64 @get_current_shot() - tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i.i) + %shot.i = tail call i64 @get_current_shot() + tail call void @print_int(ptr nonnull @res_shot.6D86EAF7.0, i64 13, i64 %shot.i) %1 = tail call i64 @teardown() ret i64 %1 } diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_sol index 297bfdae0..819135b07 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-qft_32/qft_32_x86_64-windows-msvc_sol @@ -29,9 +29,9 @@ cond_20_case_1: ; preds = %alloca_block, %cond %2 = add nuw nsw i64 %"15_0.sroa.0.0824", 1 %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_616_case_0.i, label %__barray_check_bounds.exit + br i1 %not_max.not.not.i, label %cond_612_case_0.i, label %__barray_check_bounds.exit -cond_616_case_0.i: ; preds = %cond_20_case_1 +cond_612_case_0.i: ; preds = %cond_20_case_1 tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable @@ -208,9 +208,9 @@ loop_body.i: ; preds = %__barray_check_boun br label %__barray_check_bounds.exit.i.i761 loop_body.preheader.i.i: ; preds = %loop_body.i764 - %"636_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 - %"636_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 - %"636_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 + %"632_1.sroa.10.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 2 + %"632_1.sroa.5.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 1 + %"632_1.sroa.0.0.i.i" = extractvalue { ptr, ptr, i64 } %126, 0 br label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i.i761: ; preds = %loop_body.i764, %"__hugr__.guppylang.std.quantum.measure_array$32.327.exit" @@ -250,20 +250,20 @@ panic.i222.i.i: ; preds = %__barray_check_boun tail call void @panic(i32 1002, ptr nonnull @"e_Array alre.5A300C2A.0") unreachable -cond_639_case_0.i.i: ; preds = %cond_exit_639.thread.i.i - %85 = lshr i64 %"636_1.sroa.10.0.i.i", 6 - %86 = getelementptr i64, ptr %"636_1.sroa.5.0.i.i", i64 %85 +cond_635_case_0.i.i: ; preds = %cond_exit_635.thread.i.i + %85 = lshr i64 %"632_1.sroa.10.0.i.i", 6 + %86 = getelementptr i64, ptr %"632_1.sroa.5.0.i.i", i64 %85 %87 = load i64, ptr %86, align 4 - %88 = and i64 %"636_1.sroa.10.0.i.i", 63 + %88 = and i64 %"632_1.sroa.10.0.i.i", 63 %89 = sub nuw nsw i64 64, %88 %90 = lshr i64 -1, %89 %91 = icmp eq i64 %88, 0 %92 = select i1 %91, i64 0, i64 %90 %93 = or i64 %87, %92 store i64 %93, ptr %86, align 4 - %last_valid.i.i.i766 = add i64 %"636_1.sroa.10.0.i.i", 31 + %last_valid.i.i.i766 = add i64 %"632_1.sroa.10.0.i.i", 31 %94 = lshr i64 %last_valid.i.i.i766, 6 - %95 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %94 + %95 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %94 %96 = load i64, ptr %95, align 4 %97 = and i64 %last_valid.i.i.i766, 63 %98 = shl nsw i64 -2, %97 @@ -280,8 +280,8 @@ cond_639_case_0.i.i: ; preds = %cond_exit_639.threa %exitcond.not.i.i.i773 = icmp eq i64 %.02.i.i.i770, %reass.sub.i.i.i767 br i1 %exitcond.not.i.i.i773, label %"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit", label %mask_block_ok.i.i.i769 -mask_block_ok.i.i.i769: ; preds = %cond_639_case_0.i.i, %102 - %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_639_case_0.i.i ] +mask_block_ok.i.i.i769: ; preds = %cond_635_case_0.i.i, %102 + %.02.i.i.i770 = phi i64 [ %103, %102 ], [ 0, %cond_635_case_0.i.i ] %gep.i.i.i771 = getelementptr i64, ptr %86, i64 %.02.i.i.i770 %104 = load i64, ptr %gep.i.i.i771, align 4 %105 = icmp eq i64 %104, -1 @@ -291,30 +291,30 @@ mask_block_err.i.i.i772: ; preds = %mask_block_ok.i.i.i tail call void @panic(i32 1002, ptr nonnull @"e_Array cont.EFA5AC45.0") unreachable -__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_639.thread.i.i, %loop_body.preheader.i.i - %"636_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_639.thread.i.i ] - %106 = add nuw nsw i64 %"636_0.0239.i.i", 1 - %107 = add i64 %"636_0.0239.i.i", %"636_1.sroa.10.0.i.i" +__barray_check_bounds.exit224.i.i: ; preds = %cond_exit_635.thread.i.i, %loop_body.preheader.i.i + %"632_0.0239.i.i" = phi i64 [ 0, %loop_body.preheader.i.i ], [ %106, %cond_exit_635.thread.i.i ] + %106 = add nuw nsw i64 %"632_0.0239.i.i", 1 + %107 = add i64 %"632_0.0239.i.i", %"632_1.sroa.10.0.i.i" %108 = lshr i64 %107, 6 - %109 = getelementptr inbounds nuw i64, ptr %"636_1.sroa.5.0.i.i", i64 %108 + %109 = getelementptr inbounds nuw i64, ptr %"632_1.sroa.5.0.i.i", i64 %108 %110 = load i64, ptr %109, align 4 %111 = and i64 %107, 63 %112 = lshr i64 %110, %111 %113 = trunc i64 %112 to i1 - br i1 %113, label %cond_exit_639.thread.i.i, label %__barray_mask_borrow.exit228.i.i + br i1 %113, label %cond_exit_635.thread.i.i, label %__barray_mask_borrow.exit228.i.i __barray_mask_borrow.exit228.i.i: ; preds = %__barray_check_bounds.exit224.i.i %114 = shl nuw i64 1, %111 %115 = xor i64 %114, %110 store i64 %115, ptr %109, align 4 - %116 = getelementptr inbounds i64, ptr %"636_1.sroa.0.0.i.i", i64 %107 + %116 = getelementptr inbounds i64, ptr %"632_1.sroa.0.0.i.i", i64 %107 %117 = load i64, ptr %116, align 4 tail call void @___dec_future_refcount(i64 %117) - br label %cond_exit_639.thread.i.i + br label %cond_exit_635.thread.i.i -cond_exit_639.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i +cond_exit_635.thread.i.i: ; preds = %__barray_mask_borrow.exit228.i.i, %__barray_check_bounds.exit224.i.i %exitcond.i.i = icmp eq i64 %106, 32 - br i1 %exitcond.i.i, label %cond_639_case_0.i.i, label %__barray_check_bounds.exit224.i.i + br i1 %exitcond.i.i, label %cond_635_case_0.i.i, label %__barray_check_bounds.exit224.i.i __barray_check_bounds.exit.i762: ; preds = %__barray_check_bounds.exit221.i.i %118 = xor i64 %82, %78 @@ -342,9 +342,9 @@ loop_body.i764: ; preds = %__barray_check_boun %exitcond.not.i765 = icmp eq i64 %70, 32 br i1 %exitcond.not.i765, label %loop_body.preheader.i.i, label %__barray_check_bounds.exit.i.i761 -"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_639_case_0.i.i - tail call void @heap_free(ptr %"636_1.sroa.0.0.i.i") - tail call void @heap_free(ptr nonnull %"636_1.sroa.5.0.i.i") +"__hugr__.guppylang.std.quantum.collect_measurements$32.286.exit": ; preds = %102, %cond_635_case_0.i.i + tail call void @heap_free(ptr %"632_1.sroa.0.0.i.i") + tail call void @heap_free(ptr nonnull %"632_1.sroa.5.0.i.i") %127 = load i64, ptr %68, align 4 %128 = and i64 %127, 4294967295 store i64 %128, ptr %68, align 4 diff --git a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol index fb595ae70..dd5d45cce 100644 --- a/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol +++ b/qis-compiler/python/tests/snapshots/test_qsystem_platforms/test_llvm_multiplatform/sol-x86_64-windows-msvc-rus/rus_x86_64-windows-msvc_sol @@ -10,34 +10,34 @@ define void @"__hugr__.__main__.rus..main.1"() local_unnamed_addr { alloca_block: %qalloc.i = tail call i64 @___qalloc() %not_max.not.not.i = icmp eq i64 %qalloc.i, -1 - br i1 %not_max.not.not.i, label %cond_102_case_0.i, label %__hugr__.__tk2_sol_qalloc.98.exit + br i1 %not_max.not.not.i, label %cond_98_case_0.i, label %__hugr__.__tk2_sol_qalloc.94.exit -cond_102_case_0.i: ; preds = %alloca_block +cond_98_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.98.exit: ; preds = %alloca_block +__hugr__.__tk2_sol_qalloc.94.exit: ; preds = %alloca_block tail call void @___reset(i64 %qalloc.i) %qalloc.i98.i = tail call i64 @___qalloc() %not_max.not.not.i99.i = icmp eq i64 %qalloc.i98.i, -1 - br i1 %not_max.not.not.i99.i, label %cond_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i + br i1 %not_max.not.not.i99.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i -cond_102_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.98.exit +cond_98_case_0.i.i: ; preds = %.backedge.i, %__hugr__.__tk2_sol_qalloc.94.exit tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.98.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit, %.backedge.i - %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.98.exit ] +__hugr__.__tk2_sol_qalloc.94.exit.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit, %.backedge.i + %qalloc.i100.i = phi i64 [ %qalloc.i.i, %.backedge.i ], [ %qalloc.i98.i, %__hugr__.__tk2_sol_qalloc.94.exit ] tail call void @___reset(i64 %qalloc.i100.i) %qalloc.i91.i = tail call i64 @___qalloc() %not_max.not.not.i92.i = icmp eq i64 %qalloc.i91.i, -1 - br i1 %not_max.not.not.i92.i, label %cond_102_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.98.exit94.i + br i1 %not_max.not.not.i92.i, label %cond_98_case_0.i93.i, label %__hugr__.__tk2_sol_qalloc.94.exit94.i -cond_102_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +cond_98_case_0.i93.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @panic(i32 1001, ptr nonnull @"e_No more qu.3B2EEBF0.0") unreachable -__hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit.i +__hugr__.__tk2_sol_qalloc.94.exit94.i: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit.i tail call void @___reset(i64 %qalloc.i91.i) tail call void @___rp(i64 %qalloc.i91.i, double 0x3FF921FB54442D18, double 0xBFF921FB54442D18) tail call void @___rz(i64 %qalloc.i91.i, double 0x400921FB54442D18) @@ -56,16 +56,16 @@ __hugr__.__tk2_sol_qalloc.98.exit94.i: ; preds = %__hugr__.__tk2_sol_ tail call void @___dec_future_refcount(i64 %lazy_measure.i) br i1 %read_bool.i.i, label %1, label %0 -0: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +0: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i tail call void @___qfree(i64 %qalloc.i91.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_102_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.98.exit.i + br i1 %not_max.not.not.i.i, label %cond_98_case_0.i.i, label %__hugr__.__tk2_sol_qalloc.94.exit.i -1: ; preds = %__hugr__.__tk2_sol_qalloc.98.exit94.i +1: ; preds = %__hugr__.__tk2_sol_qalloc.94.exit94.i 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) diff --git a/qis-compiler/rust/lib.rs b/qis-compiler/rust/lib.rs index 1e8ea8533..61f4b01c2 100644 --- a/qis-compiler/rust/lib.rs +++ b/qis-compiler/rust/lib.rs @@ -18,6 +18,7 @@ use inkwell::targets::{ }; use itertools::Itertools; use pyo3::prelude::*; +use tket::hugr::ops::DataflowParent; use tket::passes::composable::ComposablePass; use std::error::Error; @@ -30,7 +31,7 @@ use tket::hugr::{self, llvm::inkwell}; use tket::hugr::{Hugr, HugrView, Node}; use tket::llvm::rotation::RotationCodegenExtension; use tket_qsystem::QSystemPass; -use tket_qsystem::extension::{REGISTRY, argreader as qsystem_argreader, qsystem}; +use tket_qsystem::extension::{REGISTRY, qsystem}; use tket_qsystem::llvm::array_utils::ArrayLowering; pub use tket_qsystem::llvm::futures::FuturesCodegenExtension; use tket_qsystem::llvm::globals::GlobalsCodegenExtension; @@ -220,12 +221,12 @@ fn get_entry_point_name(namer: &Namer, hugr: &impl HugrView) -> Res .entrypoint_optype() .as_func_defn() .ok_or_else(|| anyhow!("Entry point node is not a function definition"))?; - /* - * TODO: Now that we don't prevent input parameters, we should still - * enforce that input parameters are of supported types, instead of potentially - * throwing an indecipherable lowering error (e.g. if the user tries to pass - * a qubit into main) - */ + if func_defn.inner_signature().input_count() != 0 { + return Err(anyhow!( + "Entry point function must have no input parameters (found {})", + func_defn.inner_signature().input_count() + )); + } (func_defn.func_name().as_ref(), hugr.entrypoint()) }; @@ -335,8 +336,6 @@ fn compile<'c, 'hugr: 'c>( event!(Level::DEBUG, "starting primary compilation"); let namer = Rc::new(Namer::new("__hugr__.", true)); - qsystem_argreader::wrap_entrypoint_with_arguments(hugr)?; - // Find the name of the LLVM function that corresponds to the entry point in // the HUGR. let hugr_entry = get_entry_point_name(&namer, hugr)?; diff --git a/tket-qsystem/src/extension/argreader.rs b/tket-qsystem/src/extension/argreader.rs index 2df298e3f..85fb6f47b 100644 --- a/tket-qsystem/src/extension/argreader.rs +++ b/tket-qsystem/src/extension/argreader.rs @@ -2,27 +2,24 @@ use std::sync::{Arc, Weak}; use hugr::{ - Extension, HugrView, Wire, - builder::{BuildError, Dataflow, DataflowSubContainer, FunctionBuilder}, + Extension, Wire, + builder::{BuildError, Dataflow}, extension::{ ExtensionId, OpDef, SignatureError, SignatureFunc, Version, - prelude::bool_t, simple_op::{ HasConcrete, HasDef, MakeExtensionOp, MakeOpDef, MakeRegisteredOp, OpLoadError, try_from_name, }, }, - hugr::{Hugr, hugrmut::HugrMut}, - ops::handle::NodeHandle, - ops::{self, OpName, OpType}, + ops::OpName, std_extensions::{ - arithmetic::{ - float_types::{self, float64_type}, - int_types::{self, LOG_WIDTH_TYPE_PARAM, int_type}, - }, + arithmetic::{float_types, int_types}, collections::borrow_array, }, - types::{PolyFuncTypeRV, Signature, SumType, Term, Type, TypeArg, type_param::TypeParam}, + types::{ + PolyFuncTypeRV, Signature, SumType, Term, Type, TypeArg, TypeBound, + type_param::TypeParam, + }, }; use anyhow::{Result, bail}; @@ -37,9 +34,9 @@ pub const EXTENSION_VERSION: Version = Version::new(0, 1, 0); lazy_static! { /// The "tket.argreader" extension. - pub static ref EXTENSION: Arc = { + pub static ref EXTENSION: Arc = { Extension::new_arc(EXTENSION_ID, EXTENSION_VERSION, |ext, ext_ref| { - ArgumentReadOpDef::load_all_ops(ext, ext_ref).unwrap(); + ReadArgOpDef::load_all_ops(ext, ext_ref).unwrap(); }) }; } @@ -60,111 +57,29 @@ lazy_static! { EnumString, )] #[non_exhaustive] -/// Runtime argument reading operations -pub enum ArgumentReadOpDef { - /// Read a boolean argument - Bool, - /// Read a signed integer argument - Int, - /// Read an unsigned integer argument - UInt, - /// Read a floating point argument - F64, - /// Read an array of boolean arguments - ArrBool, - /// Read an array of signed integer arguments - ArrInt, - /// Read an array of unsigned integer arguments - ArrUInt, - /// Read an array of floating point arguments - ArrF64, -} - -fn borrow_array_type(inner_t: Type) -> Type { - borrow_array::borrow_array_type_parametric( - TypeArg::new_var_use(1, TypeParam::max_nat_kind()), - inner_t, - ) - .unwrap() -} - -fn int_tv(int_tv_idx: usize) -> Type { - int_type(TypeArg::new_var_use(int_tv_idx, LOG_WIDTH_TYPE_PARAM)) +/// Runtime argument reading operation +pub enum ReadArgOpDef { + /// Read a runtime argument of any supported type, identified by a string tag + #[strum(serialize = "read_arg")] + ReadArg, } -impl ArgumentReadOpDef { - /// Type of the return value of this argument - pub fn output_type(&self) -> Type { - match self { - Self::Bool => bool_t(), - Self::Int | Self::UInt => int_tv(1), - Self::F64 => float64_type(), - Self::ArrBool | Self::ArrF64 => { - let inner_t = self.simple_type_op().output_type(); - borrow_array_type(inner_t) - } - Self::ArrInt | Self::ArrUInt => borrow_array_type(int_tv(2)), - } - } - - /// If the operation is on an array type, returns the inner element. - /// Otherwise returns itself. - pub fn simple_type_op(&self) -> Self { - match self { - Self::ArrBool => Self::Bool, - Self::ArrInt => Self::Int, - Self::ArrUInt => Self::UInt, - Self::ArrF64 => Self::F64, - _ => *self, - } - } - /// If the operation is a scalar, returns the corresponding array type. - /// Otherwise, it is already an array and returns itself. - pub fn array_type_op(&self) -> Self { - match self { - Self::Bool => Self::ArrBool, - Self::Int => Self::ArrInt, - Self::UInt => Self::ArrUInt, - Self::F64 => Self::ArrF64, - _ => *self, - } - } - /// Get the description of this operation, for use in documentation and error messages. - pub fn get_description(&self) -> String { - match self { - Self::Bool => "Read a boolean argument", - Self::Int => "Read an i64 argument", - Self::UInt => "Read a u64 argument", - Self::F64 => "Read an f64 argument", - Self::ArrBool => "Read an array of boolean arguments", - Self::ArrInt => "Read an array of i64 arguments", - Self::ArrUInt => "Read an array of u64 arguments", - Self::ArrF64 => "Read an array of f64 arguments", - } - .to_string() - } -} -impl MakeOpDef for ArgumentReadOpDef { - fn opdef_id(&self) -> hugr::ops::OpName { +impl MakeOpDef for ReadArgOpDef { + fn opdef_id(&self) -> OpName { <&'static str>::from(self).into() } fn init_signature(&self, _extension_ref: &Weak) -> SignatureFunc { - let params = match self { - // tag - Self::Bool | Self::F64 => vec![TypeParam::StringKind], - Self::Int | Self::UInt => vec![TypeParam::StringKind, LOG_WIDTH_TYPE_PARAM], - Self::ArrBool | Self::ArrF64 => vec![TypeParam::StringKind, TypeParam::max_nat_kind()], - Self::ArrInt | Self::ArrUInt => vec![ - TypeParam::StringKind, - LOG_WIDTH_TYPE_PARAM, - TypeParam::max_nat_kind(), - ], - }; - PolyFuncTypeRV::new(params, Signature::new(vec![], vec![self.output_type()])).into() + // Params: [0: tag (string), 1: output type T (any runtime type, including linear)] + let t_var = Type::new_var_use(1, TypeBound::Linear); + PolyFuncTypeRV::new( + vec![TypeParam::StringKind, TypeBound::Linear.into()], + Signature::new(vec![], vec![t_var]), + ) + .into() } - fn from_def(op_def: &OpDef) -> Result { + fn from_def(op_def: &OpDef) -> Result { try_from_name(op_def.name(), op_def.extension_id()) } @@ -173,7 +88,7 @@ impl MakeOpDef for ArgumentReadOpDef { } fn description(&self) -> String { - self.get_description() + "Read a runtime argument of the given type identified by a string tag".to_string() } fn extension_ref(&self) -> Weak { @@ -181,93 +96,28 @@ impl MakeOpDef for ArgumentReadOpDef { } } -#[derive(Clone, Debug, Serialize, Deserialize, Hash, PartialEq)] -/// The possible scalar arguments for an `ArgumentReadOpDef`. -pub enum SimpleArgs { - /// The read is of a boolean - Bool, - /// The read is of a signed integer, with the given bit width (e.g. 8 for i8, 64 for i64) - Int(u8), - /// The read is of an unsigned integer, with the given bit width (e.g. 8 for u8, 64 for u64) - UInt(u8), - /// The read is of a 64-bit floating point number - F64, -} - #[derive(Debug, Clone, PartialEq)] -/// The arguments for an `ArgumentReadOpDef`, which may be either a simple scalar argument or an -/// array argument with a size. -pub enum ReadArgs { - /// A simple scalar argument - Simple(SimpleArgs), - /// An array of a simple scalar argument, with the given length - Array(SimpleArgs, u64), -} - -#[derive(Debug, Clone, PartialEq)] -/// An operation providing a mechanism for requesting runtime arguments -pub struct ArgumentReadOp { - /// Static string tag for the argument. +/// A concrete operation that reads a typed runtime argument identified by a string tag. +pub struct ReadArgOp { + /// String tag identifying the argument (must match the provider's key). pub tag: String, - /// The operation definition - pub read_op: ArgumentReadOpDef, - /// Type arguments for the operation - pub args: ReadArgs, + /// The HUGR type of the argument to read. + pub output_type: Type, } -impl ArgumentReadOp { - /// Create a new `ArgumentRead` operation for an unsigned integer return value - pub fn new_uint(tag: impl Into, int_width: u8) -> Self { - Self { - tag: tag.into(), - read_op: ArgumentReadOpDef::UInt, - args: ReadArgs::Simple(SimpleArgs::UInt(int_width)), - } - } - /// Create a new `ArgumentRead` operation for a signed integer return value - pub fn new_int(tag: impl Into, int_width: u8) -> Self { +impl ReadArgOp { + /// Create a new `ReadArgOp` for the given tag and output type. + pub fn new(tag: impl Into, output_type: Type) -> Self { Self { tag: tag.into(), - read_op: ArgumentReadOpDef::Int, - args: ReadArgs::Simple(SimpleArgs::Int(int_width)), - } - } - /// Create a new `ArgumentRead` operation for a boolean return value - pub fn new_bool(tag: impl Into) -> Self { - Self { - tag: tag.into(), - read_op: ArgumentReadOpDef::Bool, - args: ReadArgs::Simple(SimpleArgs::Bool), - } - } - /// Create a new `ArgumentRead` operation for a 64-bit floating point return value - pub fn new_f64(tag: impl Into) -> Self { - Self { - tag: tag.into(), - read_op: ArgumentReadOpDef::F64, - args: ReadArgs::Simple(SimpleArgs::F64), - } - } - /// Convert this `ArgumentRead` operation to one that reads an array of the same type, with the - /// given size. - pub fn array_op(mut self, size: u64) -> Self { - match &mut self.args { - ReadArgs::Simple(s_args) => { - self.args = ReadArgs::Array(s_args.clone(), size); - self.read_op = self.read_op.array_type_op(); - self - } - ReadArgs::Array(_, s) => { - *s = size; - self - } + output_type, } } } -impl MakeExtensionOp for ArgumentReadOp { +impl MakeExtensionOp for ReadArgOp { fn op_id(&self) -> OpName { - self.read_op.opdef_id() + ReadArgOpDef::ReadArg.opdef_id() } fn from_extension_op(ext_op: &hugr::ops::ExtensionOp) -> Result @@ -276,33 +126,19 @@ impl MakeExtensionOp for ArgumentReadOp { { let def = ext_op.def(); let args = ext_op.args(); - let read_op_def = ArgumentReadOpDef::from_def(def)?; + let read_op_def = ReadArgOpDef::from_def(def)?; read_op_def.instantiate(args) } fn type_args(&self) -> Vec { - let mut type_args = vec![self.tag.clone().into()]; - match self.args { - ReadArgs::Simple(SimpleArgs::Int(width)) - | ReadArgs::Simple(SimpleArgs::UInt(width)) => { - type_args.push(TypeArg::BoundedNat(width as u64)); - } - ReadArgs::Array(SimpleArgs::Int(width), size) - | ReadArgs::Array(SimpleArgs::UInt(width), size) => { - type_args.push(TypeArg::BoundedNat(size)); - type_args.push(TypeArg::BoundedNat(width as u64)); - } - ReadArgs::Simple(SimpleArgs::Bool) => {} - ReadArgs::Simple(SimpleArgs::F64) => {} - ReadArgs::Array(SimpleArgs::Bool, size) | ReadArgs::Array(SimpleArgs::F64, size) => { - type_args.push(TypeArg::BoundedNat(size)); - } - } - type_args + vec![ + self.tag.clone().into(), + Term::from(self.output_type.clone()), + ] } } -impl MakeRegisteredOp for ArgumentReadOp { +impl MakeRegisteredOp for ReadArgOp { fn extension_id(&self) -> ExtensionId { EXTENSION_ID } @@ -312,225 +148,204 @@ impl MakeRegisteredOp for ArgumentReadOp { } } -impl TryFrom<&OpType> for ArgumentReadOpDef { - type Error = OpLoadError; - fn try_from(value: &OpType) -> Result { - let Some(ext) = value.as_extension_op() else { - return Err(OpLoadError::NotMember(value.to_string())); - }; - Self::from_extension_op(ext) - } -} - -/// A builder trait for adding `ArgumentReadOp`s to a dataflow. -pub trait ArgumentReadOpBuilder: Dataflow { - /// Add an `ArgumentReadOp` to this dataflow, returning the output wire of the operation. - fn add_read(&mut self, op: ArgumentReadOp) -> Result { - let handle = self.add_dataflow_op(op, [])?; - debug_assert!(handle.outputs().len() == 1); - Ok(handle.out_wire(0)) - } -} -impl ArgumentReadOpBuilder for D {} - -impl HasDef for ArgumentReadOp { - type Def = ArgumentReadOpDef; +impl HasDef for ReadArgOp { + type Def = ReadArgOpDef; } -impl HasConcrete for ArgumentReadOpDef { - type Concrete = ArgumentReadOp; +impl HasConcrete for ReadArgOpDef { + type Concrete = ReadArgOp; fn instantiate(&self, type_args: &[TypeArg]) -> Result { - match (self, type_args) { - (Self::Bool, [TypeArg::String(arg)]) => Ok(ArgumentReadOp::new_bool(arg)), - - (Self::F64, [TypeArg::String(arg)]) => Ok(ArgumentReadOp::new_f64(arg)), - - (Self::Int, [TypeArg::String(arg), TypeArg::BoundedNat(log_width)]) => { - Ok(ArgumentReadOp::new_int(arg, *log_width as u8)) - } - - (Self::UInt, [TypeArg::String(arg), TypeArg::BoundedNat(log_width)]) => { - Ok(ArgumentReadOp::new_uint(arg, *log_width as u8)) - } - - (Self::ArrBool, [TypeArg::String(arg), TypeArg::BoundedNat(size)]) => { - Ok(ArgumentReadOp::new_bool(arg).array_op(*size)) - } - - (Self::ArrF64, [TypeArg::String(arg), TypeArg::BoundedNat(size)]) => { - Ok(ArgumentReadOp::new_f64(arg).array_op(*size)) + match type_args { + [TypeArg::String(tag), ty_arg] => { + let output_type = + Type::try_from(ty_arg.clone()).map_err(|_| SignatureError::InvalidTypeArgs)?; + Ok(ReadArgOp { + tag: tag.clone(), + output_type, + }) } - - ( - Self::ArrInt, - [ - TypeArg::String(arg), - TypeArg::BoundedNat(size), - TypeArg::BoundedNat(log_width), - ], - ) => Ok(ArgumentReadOp::new_int(arg, *log_width as u8).array_op(*size)), - - ( - Self::ArrUInt, - [ - TypeArg::String(arg), - TypeArg::BoundedNat(size), - TypeArg::BoundedNat(log_width), - ], - ) => Ok(ArgumentReadOp::new_uint(arg, *log_width as u8).array_op(*size)), - _ => Err(SignatureError::InvalidTypeArgs.into()), } } } -/// Map a HUGR type to an `ArgumentReadOp` that can read an argument of that type at runtime. +/// A builder trait for adding `ReadArgOp`s to a dataflow. +pub trait ReadArgBuilder: Dataflow { + /// Emit a `ReadArgOp` returning a value of the given type identified by `tag`. + fn add_read_arg( + &mut self, + tag: impl Into, + output_type: Type, + ) -> Result { + let op = ReadArgOp::new(tag, output_type); + let handle = self.add_dataflow_op(op, [])?; + debug_assert_eq!(handle.outputs().len(), 1); + Ok(handle.out_wire(0)) + } +} +impl ReadArgBuilder for D {} + +/// The concrete variant of an argument type, used to select the selene extern function. +#[derive(Debug, Clone, PartialEq)] +pub enum ArgKind { + /// A boolean argument + Bool, + /// A signed 64-bit integer argument (any int log-width) + Int, + /// A 64-bit floating-point argument + F64, + /// An array of booleans with a fixed length + ArrBool(u64), + /// An array of signed 64-bit integers with a fixed length + ArrInt(u64), + /// An array of 64-bit floats with a fixed length + ArrF64(u64), +} + +/// Classify the concrete output type of a [`ReadArgOp`] into the corresponding +/// selene runtime function variant. /// -/// TODO: This function requires a lot of attention. It feels like -/// it must be the wrong way to do it, but the right way isn't clear -/// to me. -pub fn map_type(hugr_type: &Type, idx: usize) -> Result { - match &**hugr_type { +/// Returns an error for types not supported as entrypoint arguments. +pub fn classify_arg_type(ty: &Type) -> Result { + match &**ty { + Term::SumType(SumType::Unit { size: 2 }) => Ok(ArgKind::Bool), Term::ExtensionType(custom) => { if *custom.extension() == int_types::EXTENSION_ID { - if custom.name() != "int" { - bail!("Can only handle int"); - } - let [TypeArg::BoundedNat(log_width)] = custom.args() else { - bail!("Expected a log width type argument"); - }; - let log_width: u64 = *log_width; - let log_width = log_width as u8; - Ok(ArgumentReadOp::new_int(format!("arg_{idx}"), log_width)) + Ok(ArgKind::Int) } else if *custom.extension() == float_types::EXTENSION_ID { - if custom.name() != "float64" { - bail!("Can only handle float64"); - } - Ok(ArgumentReadOp::new_f64(format!("arg_{idx}"))) + Ok(ArgKind::F64) } else if *custom.extension() == borrow_array::EXTENSION_ID { - if custom.name() != "borrow_array" { - bail!("Can only handle borrow_array"); - } match custom.args() { - [TypeArg::BoundedNat(n_elements), element_type] => match element_type { - Term::ExtensionType(elem) => { - if *elem.extension() == int_types::EXTENSION_ID { - if elem.name() != "int" { - bail!("Can only handle int element types in borrow array"); - } - let [TypeArg::BoundedNat(log_width)] = elem.args() else { - bail!( - "Expected a log width type argument for int element type in borrow array" - ); - }; - let log_width: u64 = *log_width; - let log_width = log_width as u8; - Ok(ArgumentReadOp::new_int(format!("arg_{idx}"), log_width) - .array_op(*n_elements)) - } else if *elem.extension() == float_types::EXTENSION_ID { - if elem.name() != "float64" { - bail!("Can only handle float64 element types in borrow array"); - } - Ok(ArgumentReadOp::new_f64(format!("arg_{idx}")) - .array_op(*n_elements)) - } else { - bail!("Unsupported element type in borrow array: {:?}", elem); - } - } - Term::SumType(st) => match st { - SumType::Unit { size: 2 } => { - Ok(ArgumentReadOp::new_bool(format!("arg_{idx}")) - .array_op(*n_elements)) - } - _ => bail!("Unsupported element type in borrow array: {:?}", st), - }, - _ => bail!( - "Unsupported element type in borrow array: {:?}", - element_type - ), - }, - _ => { - bail!( - "Expected a borrow_array with a bounded nat and an element type as arguments" - ); - } + [TypeArg::BoundedNat(n), elem] => classify_borrow_array_elem(elem, *n), + _ => bail!("Unexpected borrow_array type args: {:?}", custom.args()), } } else { - bail!("Unsupported extension type: {:?}", custom.extension()); + bail!( + "Unsupported extension type for argument reading: {:?}", + custom.extension() + ) } } - Term::SumType(st) => match st { - SumType::Unit { size: 2 } => Ok(ArgumentReadOp::new_bool(format!("arg_{idx}"))), - _ => bail!("Unsupported sum type: {:?}", st), - }, - _ => bail!("Unsupported type: {:?}", hugr_type), + other => bail!("Unsupported type for argument reading: {:?}", other), } } -/// If the incoming HUGR has an entrypoint function with arguments, this function -/// replaces the entrypoint with one that takes no arguments, instead reading them -/// using `ArgReaderOp`s tagged by the respective input argument names. This new -/// entrypoint then invokes the original entrypoint with the read arguments. -/// -/// If the incoming HUGR's entrypoint has no arguments, this function does not mutate -/// the HUGR and returns successfully. -pub fn wrap_entrypoint_with_arguments(hugr: &mut Hugr) -> Result<()> { - let original_entrypoint = hugr.entrypoint(); +fn classify_borrow_array_elem(elem: &Term, len: u64) -> Result { + match elem { + Term::SumType(SumType::Unit { size: 2 }) => Ok(ArgKind::ArrBool(len)), + Term::ExtensionType(e) if *e.extension() == int_types::EXTENSION_ID => { + Ok(ArgKind::ArrInt(len)) + } + Term::ExtensionType(e) if *e.extension() == float_types::EXTENSION_ID => { + Ok(ArgKind::ArrF64(len)) + } + other => bail!( + "Unsupported element type in borrow_array for argument reading: {:?}", + other + ), + } +} - let original_sig = { - let Some(original_func_defn) = hugr.get_optype(original_entrypoint).as_func_defn() else { - bail!("Entrypoint is not a function"); - }; +#[cfg(test)] +pub(crate) mod test { + use super::*; + use hugr::extension::prelude::bool_t; + use hugr::extension::simple_op::{HasConcrete, MakeRegisteredOp}; + use hugr::std_extensions::arithmetic::{float_types::float64_type, int_types::int_type}; + use hugr::std_extensions::collections::borrow_array::borrow_array_type; + + fn roundtrip(op: ReadArgOp) -> ReadArgOp { + let type_args = op.type_args(); + ReadArgOpDef::ReadArg.instantiate(&type_args).unwrap() + } - original_func_defn.signature().clone() - }; + #[test] + fn test_bool_roundtrip() { + let op = ReadArgOp::new("my_bool", bool_t()); + assert_eq!(roundtrip(op.clone()), op); + } - // The wrapper takes no ordinary inputs; it reads them via your ArgumentReadOp-like ops. - // It returns exactly what the original entrypoint returns. - let wrapper_sig = Signature::new( - [], // wrapper inputs - original_sig.body().output().clone(), // wrapper outputs - ); - - // Direct Call has a static/function input after its normal dataflow inputs. - // Capture this before constructing the builder, because the builder borrows `hugr` mutably. - let original_func_wire = { - let original_op = hugr.get_optype(original_entrypoint); - let Some(static_out) = original_op.static_output_port() else { - bail!("Original entrypoint has no static function output port"); - }; - Wire::new(original_entrypoint, static_out) - }; + #[test] + fn test_int_roundtrip() { + let op = ReadArgOp::new("my_int", int_type(TypeArg::BoundedNat(6))); + assert_eq!(roundtrip(op.clone()), op); + } - let wrapper_node = { - let mut f_build = - FunctionBuilder::with_hugr(&mut *hugr, "__wrapped_entrypoint", wrapper_sig)?; + #[test] + fn test_f64_roundtrip() { + let op = ReadArgOp::new("my_f64", float64_type()); + assert_eq!(roundtrip(op.clone()), op); + } - let mut call_inputs = Vec::new(); + #[test] + fn test_arr_bool_roundtrip() { + let op = ReadArgOp::new("my_arr_bool", borrow_array_type(10, bool_t())); + assert_eq!(roundtrip(op.clone()), op); + } - for (nth_arg, argument_type) in original_sig.body().input().iter().enumerate() { - let arg_reader_op = map_type(argument_type, nth_arg)?; - // need to create a string - let arg_reader = f_build.add_read(arg_reader_op)?; - call_inputs.push(arg_reader); - } - let call_op = ops::Call::try_new(original_sig.clone(), [])?; - call_inputs.push(original_func_wire); - let call = f_build.add_dataflow_op(call_op, call_inputs)?; - let wrapper_func = f_build.finish_with_outputs(call.outputs())?; - wrapper_func.node() - }; + #[test] + fn test_arr_int_roundtrip() { + let op = ReadArgOp::new( + "my_arr_int", + borrow_array_type(10, int_type(TypeArg::BoundedNat(6))), + ); + assert_eq!(roundtrip(op.clone()), op); + } - hugr.set_entrypoint(wrapper_node); + #[test] + fn test_arr_f64_roundtrip() { + let op = ReadArgOp::new("my_arr_f64", borrow_array_type(10, float64_type())); + assert_eq!(roundtrip(op.clone()), op); + } - Ok(()) -} + #[test] + fn test_classify_bool() { + assert_eq!(classify_arg_type(&bool_t()).unwrap(), ArgKind::Bool); + } + + #[test] + fn test_classify_int() { + assert_eq!( + classify_arg_type(&int_type(TypeArg::BoundedNat(6))).unwrap(), + ArgKind::Int + ); + } + + #[test] + fn test_classify_f64() { + assert_eq!(classify_arg_type(&float64_type()).unwrap(), ArgKind::F64); + } + + #[test] + fn test_classify_arr_bool() { + assert_eq!( + classify_arg_type(&borrow_array_type(10, bool_t())).unwrap(), + ArgKind::ArrBool(10) + ); + } + + #[test] + fn test_classify_arr_int() { + assert_eq!( + classify_arg_type(&borrow_array_type(10, int_type(TypeArg::BoundedNat(6)))).unwrap(), + ArgKind::ArrInt(10) + ); + } + + #[test] + fn test_classify_arr_f64() { + assert_eq!( + classify_arg_type(&borrow_array_type(10, float64_type())).unwrap(), + ArgKind::ArrF64(10) + ); + } -#[cfg(test)] -pub(crate) mod test { #[test] - fn test_entrypoint_args() { - // TODO + fn test_to_extension_op_roundtrip() { + let op = ReadArgOp::new("my_bool", bool_t()); + let ext_op = op.clone().to_extension_op().expect("should build extension op"); + let roundtripped = ReadArgOp::from_extension_op(&ext_op).expect("should decode"); + assert_eq!(roundtripped, op); } } diff --git a/tket-qsystem/src/llvm/argreader.rs b/tket-qsystem/src/llvm/argreader.rs index 63f871dcc..282f61b7d 100644 --- a/tket-qsystem/src/llvm/argreader.rs +++ b/tket-qsystem/src/llvm/argreader.rs @@ -1,8 +1,8 @@ -//! LLVM lowering implementations for "tket.results" extension. +//! LLVM lowering implementations for the "tket.argreader" extension. -use crate::extension::argreader::{ArgumentReadOp, ArgumentReadOpDef, ReadArgs}; +use crate::extension::argreader::{ArgKind, ReadArgOp, ReadArgOpDef, classify_arg_type}; use crate::llvm::prelude::emit_global_string; -use anyhow::{Result, anyhow, bail}; +use anyhow::{Result, bail}; use hugr::llvm::CodegenExtsBuilder; use hugr::llvm::custom::CodegenExtension; use hugr::llvm::emit::{EmitFuncContext, EmitOpArgs}; @@ -11,13 +11,13 @@ use hugr::llvm::inkwell; use inkwell::AddressSpace; use inkwell::builder::Builder; use inkwell::context::Context; -use inkwell::types::{BasicType, FloatType, IntType, PointerType, VoidType}; -use inkwell::values::FunctionValue; +use inkwell::types::{BasicType, BasicTypeEnum, FloatType, IntType, PointerType, VoidType}; +use inkwell::values::{BasicValueEnum, FunctionValue}; use tket::hugr::extension::simple_op::MakeExtensionOp; use tket::hugr::ops::ExtensionOp; use tket::hugr::{HugrView, Node}; -/// Codegen extension for results +/// Codegen extension for the argreader #[derive(Default)] pub struct ArgReaderCodegenExtension { borrow_array_codegen: BAC, @@ -40,8 +40,8 @@ impl CodegenExtension for ArgReaderCodegenExten where Self: 'a, { - builder.simple_extension_op::(move |context, args, _op| { - let op = ArgumentReadOp::from_extension_op(args.node().as_ref())?; + builder.simple_extension_op::(move |context, args, _op| { + let op = ReadArgOp::from_extension_op(args.node().as_ref())?; ArgReaderEmitter(context, self.borrow_array_codegen.clone()).emit(args, &op) }) } @@ -83,25 +83,21 @@ impl<'c, H: HugrView, BAC: BorrowArrayCodegen + Clone> self.0.builder() } - pub fn get_argreader_func(&self, op: &ArgumentReadOp) -> Result> { - let (fn_type, func_name) = match op.read_op { - ArgumentReadOpDef::Bool => ( + fn get_argreader_func(&self, kind: &ArgKind) -> Result> { + let (fn_type, func_name) = match kind { + ArgKind::Bool => ( self.bool_t().fn_type(&[self.ptr_t().into()], false), "argreader_get_bool", ), - ArgumentReadOpDef::Int => ( + ArgKind::Int => ( self.i64_t().fn_type(&[self.ptr_t().into()], false), "argreader_get_i64", ), - ArgumentReadOpDef::UInt => ( - self.i64_t().fn_type(&[self.ptr_t().into()], false), - "argreader_get_u64", - ), - ArgumentReadOpDef::F64 => ( + ArgKind::F64 => ( self.f64_t().fn_type(&[self.ptr_t().into()], false), "argreader_get_f64", ), - ArgumentReadOpDef::ArrBool => ( + ArgKind::ArrBool(_) => ( self.void_t().fn_type( &[ self.ptr_t().into(), @@ -112,7 +108,7 @@ impl<'c, H: HugrView, BAC: BorrowArrayCodegen + Clone> ), "argreader_get_bool_array", ), - ArgumentReadOpDef::ArrInt => ( + ArgKind::ArrInt(_) => ( self.void_t().fn_type( &[ self.ptr_t().into(), @@ -123,18 +119,7 @@ impl<'c, H: HugrView, BAC: BorrowArrayCodegen + Clone> ), "argreader_get_i64_array", ), - ArgumentReadOpDef::ArrUInt => ( - self.void_t().fn_type( - &[ - self.ptr_t().into(), - self.ptr_t().into(), - self.i64_t().into(), - ], - false, - ), - "argreader_get_u64_array", - ), - ArgumentReadOpDef::ArrF64 => ( + ArgKind::ArrF64(_) => ( self.void_t().fn_type( &[ self.ptr_t().into(), @@ -149,129 +134,126 @@ impl<'c, H: HugrView, BAC: BorrowArrayCodegen + Clone> self.0.get_extern_func(func_name, fn_type) } - /// Function to help lower the tket result extension. fn emit( &mut self, args: EmitOpArgs<'c, '_, ExtensionOp, H>, - op: &ArgumentReadOp, + op: &ReadArgOp, ) -> Result<()> { - let argread_fn = self.get_argreader_func(op)?; - let op = ArgumentReadOp::from_extension_op(args.node().as_ref())?; - let tag = op.tag; - if tag.is_empty() { + if op.tag.is_empty() { bail!("Empty argument name tag received"); } - let tag_ptr = emit_global_string(self.0, tag, "argument_", "")?; - let result = match op.read_op { - ArgumentReadOpDef::Bool => self + let kind = classify_arg_type(&op.output_type)?; + let argread_fn = self.get_argreader_func(&kind)?; + let tag_ptr = emit_global_string(self.0, &op.tag, "argument_", "")?; + + let result = match kind { + ArgKind::Bool => self .builder() .build_call(argread_fn, &[tag_ptr.into()], "read_arg_bool")? .try_as_basic_value() .unwrap_basic(), - ArgumentReadOpDef::Int => self + ArgKind::Int => self .builder() .build_call(argread_fn, &[tag_ptr.into()], "read_arg_int")? .try_as_basic_value() .unwrap_basic(), - ArgumentReadOpDef::UInt => self - .builder() - .build_call(argread_fn, &[tag_ptr.into()], "read_arg_uint")? - .try_as_basic_value() - .unwrap_basic(), - ArgumentReadOpDef::F64 => self + ArgKind::F64 => self .builder() .build_call(argread_fn, &[tag_ptr.into()], "read_arg_f64")? .try_as_basic_value() .unwrap_basic(), - ArgumentReadOpDef::ArrBool => { - let ReadArgs::Array(_, len) = op.args else { - bail!("Expected array read args for ArrBool"); - }; - let len: u32 = len - .try_into() - .map_err(|_| anyhow!("Array length exceeds u32::MAX"))?; - let elem_ty = self.bool_t().as_basic_type_enum(); - let len_val = self.i64_t().const_int(len as u64, false); - - let (elems_ptr, barray_value) = - borrow_array::build_barray_alloc(self.0, &self.1, elem_ty, len as u64, false)?; - - self.builder().build_call( - argread_fn, - &[tag_ptr.into(), elems_ptr.into(), len_val.into()], - "read_arg_bool_array", - )?; - - barray_value.into() - } - ArgumentReadOpDef::ArrInt => { - let ReadArgs::Array(_, len) = op.args else { - bail!("Expected array read args for ArrInt"); - }; - let len: u32 = len - .try_into() - .map_err(|_| anyhow!("Array length exceeds u32::MAX"))?; - let elem_ty = self.i64_t().as_basic_type_enum(); - let len_val = self.i64_t().const_int(len as u64, false); - - let (elems_ptr, barray_value) = - borrow_array::build_barray_alloc(self.0, &self.1, elem_ty, len as u64, false)?; - - self.builder().build_call( - argread_fn, - &[tag_ptr.into(), elems_ptr.into(), len_val.into()], - "read_arg_int_array", - )?; - barray_value.into() - } - ArgumentReadOpDef::ArrUInt => { - let ReadArgs::Array(_, len) = op.args else { - bail!("Expected array read args for ArrUInt"); - }; - let len: u32 = len - .try_into() - .map_err(|_| anyhow!("Array length exceeds u32::MAX"))?; - let elem_ty = self.i64_t().as_basic_type_enum(); - let len_val = self.i64_t().const_int(len as u64, false); - - let (elems_ptr, barray_value) = - borrow_array::build_barray_alloc(self.0, &self.1, elem_ty, len as u64, false)?; - - self.builder().build_call( - argread_fn, - &[tag_ptr.into(), elems_ptr.into(), len_val.into()], - "read_arg_uint_array", - )?; - barray_value.into() - } - ArgumentReadOpDef::ArrF64 => { - let ReadArgs::Array(_, len) = op.args else { - bail!("Expected array read args for ArrF64"); - }; - let len: u32 = len - .try_into() - .map_err(|_| anyhow!("Array length exceeds u32::MAX"))?; - let elem_ty = self.f64_t().as_basic_type_enum(); - let len_val = self.i64_t().const_int(len as u64, false); - - let (elems_ptr, barray_value) = - borrow_array::build_barray_alloc(self.0, &self.1, elem_ty, len as u64, false)?; - - self.builder().build_call( - argread_fn, - &[tag_ptr.into(), elems_ptr.into(), len_val.into()], - "read_arg_f64_array", - )?; - barray_value.into() - } + ArgKind::ArrBool(len) => self.emit_array_read( + argread_fn, + tag_ptr, + len, + self.bool_t().as_basic_type_enum(), + "read_arg_bool_array", + )?, + ArgKind::ArrInt(len) => self.emit_array_read( + argread_fn, + tag_ptr, + len, + self.i64_t().as_basic_type_enum(), + "read_arg_int_array", + )?, + ArgKind::ArrF64(len) => self.emit_array_read( + argread_fn, + tag_ptr, + len, + self.f64_t().as_basic_type_enum(), + "read_arg_f64_array", + )?, }; + args.outputs.finish(self.builder(), [result]) } + + fn emit_array_read( + &mut self, + argread_fn: FunctionValue<'c>, + tag_ptr: BasicValueEnum<'c>, + len: u64, + elem_ty: BasicTypeEnum<'c>, + call_name: &str, + ) -> Result> { + if len > u32::MAX as u64 { + bail!("Array length {} exceeds u32::MAX", len); + } + let len_val = self.i64_t().const_int(len, false); + let (elems_ptr, barray_value) = + borrow_array::build_barray_alloc(self.0, &self.1, elem_ty, len, false)?; + self.builder().build_call( + argread_fn, + &[tag_ptr.into(), elems_ptr.into(), len_val.into()], + call_name, + )?; + Ok(barray_value.into()) + } } #[cfg(test)] mod test { - // TODO - // Tket2/HUGR devs will be far better equipped to write - // appropriate tests for this than I. + use super::*; + use crate::extension::argreader::ReadArgOp; + use hugr::extension::prelude::bool_t; + use hugr::extension::simple_op::MakeRegisteredOp; + use hugr::llvm::check_emission; + use hugr::llvm::extension::collections::borrow_array::{ + BorrowArrayCodegenExtension, DefaultBorrowArrayCodegen, + }; + use hugr::llvm::test::{TestContext, llvm_ctx, single_op_hugr}; + use hugr::std_extensions::arithmetic::{float_types::float64_type, int_types::int_type}; + use hugr::std_extensions::collections::borrow_array::borrow_array_type; + use hugr::types::TypeArg; + use rstest::rstest; + + use crate::llvm::prelude::QISPreludeCodegen; + + #[rstest] + #[case::bool(1, ReadArgOp::new("test_bool", bool_t()))] + #[case::int(2, ReadArgOp::new("test_int", int_type(TypeArg::BoundedNat(6))))] + #[case::f64(3, ReadArgOp::new("test_f64", float64_type()))] + #[case::arr_bool(4, ReadArgOp::new("test_arr_bool", borrow_array_type(10, bool_t())))] + #[case::arr_int(5, ReadArgOp::new("test_arr_int", borrow_array_type(10, int_type(TypeArg::BoundedNat(6)))))] + #[case::arr_f64(6, ReadArgOp::new("test_arr_f64", borrow_array_type(10, float64_type())))] + #[should_panic(expected = "Empty argument name tag received")] + #[case::empty_tag(7, ReadArgOp::new("", bool_t()))] + fn emit_argreader_codegen( + #[case] _i: i32, + #[with(_i)] mut llvm_ctx: TestContext, + #[case] op: ReadArgOp, + ) { + let pcg = QISPreludeCodegen; + let bac = DefaultBorrowArrayCodegen::::default(); + llvm_ctx.add_extensions(move |ceb| { + ceb.add_extension(ArgReaderCodegenExtension::new(bac.clone())) + .add_extension(BorrowArrayCodegenExtension::from(bac.clone())) + .add_prelude_extensions(pcg.clone()) + .add_default_int_extensions() + .add_float_extensions() + }); + let ext_op = op.to_extension_op().unwrap().into(); + let mut hugr = single_op_hugr(ext_op); + check_emission!(hugr, llvm_ctx); + } } diff --git a/tket-qsystem/src/llvm/prelude.rs b/tket-qsystem/src/llvm/prelude.rs index 59a947254..74d6e8cd0 100644 --- a/tket-qsystem/src/llvm/prelude.rs +++ b/tket-qsystem/src/llvm/prelude.rs @@ -14,7 +14,7 @@ use inkwell::types::{BasicType, IntType}; use inkwell::values::{BasicValue, BasicValueEnum, FunctionValue, StructValue}; use tket::hugr::{HugrView, Node}; -#[derive(Clone)] +#[derive(Clone, Default)] /// Codegen extension for the QIS prelude. pub struct QISPreludeCodegen; diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_1.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_1.snap new file mode 100644 index 000000000..da0dec249 --- /dev/null +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_1.snap @@ -0,0 +1,32 @@ +--- +source: tket-qsystem/src/llvm/argreader.rs +expression: mod_str +--- +; ModuleID = 'test_context' +source_filename = "test_context" + +@argument_test_bool.07B15E44.0 = private constant [10 x i8] c"\09test_bool" + +define internal i1 @_hl.main.1() !dbg !3 { +alloca_block: + br label %entry_block + +entry_block: ; preds = %alloca_block + %read_arg_bool = call i1 @argreader_get_bool(ptr @argument_test_bool.07B15E44.0), !dbg !8 + ret i1 %read_arg_bool +} + +declare i1 @argreader_get_bool(ptr) + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "hugr_llvm_test", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "/lPNzlV/ClAphFG/yrhvZs/eDgUn/eIVwAutKJHaZEPSZwPXPeycUvnujGxZ") +!3 = distinct !DISubprogram(name: "_hl.main.1", linkageName: "_hl.main.1", scope: null, file: !4, line: 25254, type: !5, scopeLine: 25255, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") +!5 = !DISubroutineType(types: !6) +!6 = !{!7} +!7 = !DIBasicType(name: "i1", size: 1, encoding: DW_ATE_unsigned) +!8 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_2.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_2.snap new file mode 100644 index 000000000..8ae9da6a7 --- /dev/null +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_2.snap @@ -0,0 +1,32 @@ +--- +source: tket-qsystem/src/llvm/argreader.rs +expression: mod_str +--- +; ModuleID = 'test_context' +source_filename = "test_context" + +@argument_test_int.B1383B8E.0 = private constant [9 x i8] c"\08test_int" + +define internal i64 @_hl.main.1() !dbg !3 { +alloca_block: + br label %entry_block + +entry_block: ; preds = %alloca_block + %read_arg_int = call i64 @argreader_get_i64(ptr @argument_test_int.B1383B8E.0), !dbg !8 + ret i64 %read_arg_int +} + +declare i64 @argreader_get_i64(ptr) + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "hugr_llvm_test", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "/lPNzlV/ClAphFG/yrhvZs/eDgUn/eIVwAutKJHaZEPSZwPXPeycUvnujGxZ") +!3 = distinct !DISubprogram(name: "_hl.main.1", linkageName: "_hl.main.1", scope: null, file: !4, line: 25254, type: !5, scopeLine: 25255, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") +!5 = !DISubroutineType(types: !6) +!6 = !{!7} +!7 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!8 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_3.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_3.snap new file mode 100644 index 000000000..0d4af247e --- /dev/null +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_3.snap @@ -0,0 +1,32 @@ +--- +source: tket-qsystem/src/llvm/argreader.rs +expression: mod_str +--- +; ModuleID = 'test_context' +source_filename = "test_context" + +@argument_test_f64.30E2B5C9.0 = private constant [9 x i8] c"\08test_f64" + +define internal double @_hl.main.1() !dbg !3 { +alloca_block: + br label %entry_block + +entry_block: ; preds = %alloca_block + %read_arg_f64 = call double @argreader_get_f64(ptr @argument_test_f64.30E2B5C9.0), !dbg !8 + ret double %read_arg_f64 +} + +declare double @argreader_get_f64(ptr) + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "hugr_llvm_test", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "/lPNzlV/ClAphFG/yrhvZs/eDgUn/eIVwAutKJHaZEPSZwPXPeycUvnujGxZ") +!3 = distinct !DISubprogram(name: "_hl.main.1", linkageName: "_hl.main.1", scope: null, file: !4, line: 25254, type: !5, scopeLine: 25255, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") +!5 = !DISubroutineType(types: !6) +!6 = !{!7} +!7 = !DIBasicType(name: "f64", size: 64, encoding: DW_ATE_float) +!8 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_4.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_4.snap new file mode 100644 index 000000000..795be1741 --- /dev/null +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_4.snap @@ -0,0 +1,49 @@ +--- +source: tket-qsystem/src/llvm/argreader.rs +expression: mod_str +--- +; ModuleID = 'test_context' +source_filename = "test_context" + +@argument_test_arr_b.A74DBE76.0 = private constant [14 x i8] c"\0Dtest_arr_bool" + +define internal { ptr, ptr, i64 } @_hl.main.1() !dbg !3 { +alloca_block: + br label %entry_block + +entry_block: ; preds = %alloca_block + %array_size = mul i64 10, ptrtoint (ptr getelementptr (i1, ptr null, i32 1) to i64), !dbg !11 + %0 = call ptr @malloc(i64 %array_size), !dbg !11 + %1 = call ptr @malloc(i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64)), !dbg !11 + call void @llvm.memset.p0.i64(ptr %1, i8 0, i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), i1 false), !dbg !11 + %2 = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0, !dbg !11 + %3 = insertvalue { ptr, ptr, i64 } %2, ptr %1, 1, !dbg !11 + %4 = insertvalue { ptr, ptr, i64 } %3, i64 0, 2, !dbg !11 + call void @argreader_get_bool_array(ptr @argument_test_arr_b.A74DBE76.0, ptr %0, i64 10), !dbg !11 + ret { ptr, ptr, i64 } %4 +} + +declare void @argreader_get_bool_array(ptr, ptr, i64) + +declare ptr @malloc(i64) + +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 + +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "hugr_llvm_test", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "/lPNzlV/ClAphFG/yrhvZs/eDgUn/eIVwAutKJHaZEPSZwPXPeycUvnujGxZ") +!3 = distinct !DISubprogram(name: "_hl.main.1", linkageName: "_hl.main.1", scope: null, file: !4, line: 25254, type: !5, scopeLine: 25255, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") +!5 = !DISubroutineType(types: !6) +!6 = !{!7} +!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !8) +!8 = !{!9, !9, !10} +!9 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) +!10 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!11 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_5.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_5.snap new file mode 100644 index 000000000..180b7f543 --- /dev/null +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_5.snap @@ -0,0 +1,49 @@ +--- +source: tket-qsystem/src/llvm/argreader.rs +expression: mod_str +--- +; ModuleID = 'test_context' +source_filename = "test_context" + +@argument_test_arr_i.EF2BFDB2.0 = private constant [13 x i8] c"\0Ctest_arr_int" + +define internal { ptr, ptr, i64 } @_hl.main.1() !dbg !3 { +alloca_block: + br label %entry_block + +entry_block: ; preds = %alloca_block + %array_size = mul i64 10, ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), !dbg !11 + %0 = call ptr @malloc(i64 %array_size), !dbg !11 + %1 = call ptr @malloc(i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64)), !dbg !11 + call void @llvm.memset.p0.i64(ptr %1, i8 0, i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), i1 false), !dbg !11 + %2 = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0, !dbg !11 + %3 = insertvalue { ptr, ptr, i64 } %2, ptr %1, 1, !dbg !11 + %4 = insertvalue { ptr, ptr, i64 } %3, i64 0, 2, !dbg !11 + call void @argreader_get_i64_array(ptr @argument_test_arr_i.EF2BFDB2.0, ptr %0, i64 10), !dbg !11 + ret { ptr, ptr, i64 } %4 +} + +declare void @argreader_get_i64_array(ptr, ptr, i64) + +declare ptr @malloc(i64) + +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 + +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "hugr_llvm_test", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "/lPNzlV/ClAphFG/yrhvZs/eDgUn/eIVwAutKJHaZEPSZwPXPeycUvnujGxZ") +!3 = distinct !DISubprogram(name: "_hl.main.1", linkageName: "_hl.main.1", scope: null, file: !4, line: 25254, type: !5, scopeLine: 25255, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") +!5 = !DISubroutineType(types: !6) +!6 = !{!7} +!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !8) +!8 = !{!9, !9, !10} +!9 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) +!10 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!11 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_6.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_6.snap new file mode 100644 index 000000000..25994274a --- /dev/null +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_6.snap @@ -0,0 +1,49 @@ +--- +source: tket-qsystem/src/llvm/argreader.rs +expression: mod_str +--- +; ModuleID = 'test_context' +source_filename = "test_context" + +@argument_test_arr_f.A22F4976.0 = private constant [13 x i8] c"\0Ctest_arr_f64" + +define internal { ptr, ptr, i64 } @_hl.main.1() !dbg !3 { +alloca_block: + br label %entry_block + +entry_block: ; preds = %alloca_block + %array_size = mul i64 10, ptrtoint (ptr getelementptr (double, ptr null, i32 1) to i64), !dbg !11 + %0 = call ptr @malloc(i64 %array_size), !dbg !11 + %1 = call ptr @malloc(i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64)), !dbg !11 + call void @llvm.memset.p0.i64(ptr %1, i8 0, i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), i1 false), !dbg !11 + %2 = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0, !dbg !11 + %3 = insertvalue { ptr, ptr, i64 } %2, ptr %1, 1, !dbg !11 + %4 = insertvalue { ptr, ptr, i64 } %3, i64 0, 2, !dbg !11 + call void @argreader_get_f64_array(ptr @argument_test_arr_f.A22F4976.0, ptr %0, i64 10), !dbg !11 + ret { ptr, ptr, i64 } %4 +} + +declare void @argreader_get_f64_array(ptr, ptr, i64) + +declare ptr @malloc(i64) + +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 + +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "hugr_llvm_test", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "/lPNzlV/ClAphFG/yrhvZs/eDgUn/eIVwAutKJHaZEPSZwPXPeycUvnujGxZ") +!3 = distinct !DISubprogram(name: "_hl.main.1", linkageName: "_hl.main.1", scope: null, file: !4, line: 25254, type: !5, scopeLine: 25255, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") +!5 = !DISubroutineType(types: !6) +!6 = !{!7} +!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !8) +!8 = !{!9, !9, !10} +!9 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) +!10 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!11 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_1.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_1.snap new file mode 100644 index 000000000..f824ed729 --- /dev/null +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_1.snap @@ -0,0 +1,38 @@ +--- +source: tket-qsystem/src/llvm/argreader.rs +expression: mod_str +--- +; ModuleID = 'test_context' +source_filename = "test_context" + +@argument_test_bool.07B15E44.0 = private constant [10 x i8] c"\09test_bool" + +define internal i1 @_hl.main.1() !dbg !3 { +alloca_block: + %"0" = alloca i1, align 1 + %"4_0" = alloca i1, align 1 + br label %entry_block + +entry_block: ; preds = %alloca_block + %read_arg_bool = call i1 @argreader_get_bool(ptr @argument_test_bool.07B15E44.0), !dbg !8 + store i1 %read_arg_bool, ptr %"4_0", align 1, !dbg !8 + %"4_01" = load i1, ptr %"4_0", align 1 + store i1 %"4_01", ptr %"0", align 1 + %"02" = load i1, ptr %"0", align 1 + ret i1 %"02" +} + +declare i1 @argreader_get_bool(ptr) + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "hugr_llvm_test", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "/lPNzlV/ClAphFG/yrhvZs/eDgUn/eIVwAutKJHaZEPSZwPXPeycUvnujGxZ") +!3 = distinct !DISubprogram(name: "_hl.main.1", linkageName: "_hl.main.1", scope: null, file: !4, line: 25254, type: !5, scopeLine: 25255, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") +!5 = !DISubroutineType(types: !6) +!6 = !{!7} +!7 = !DIBasicType(name: "i1", size: 1, encoding: DW_ATE_unsigned) +!8 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_2.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_2.snap new file mode 100644 index 000000000..9bddda089 --- /dev/null +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_2.snap @@ -0,0 +1,38 @@ +--- +source: tket-qsystem/src/llvm/argreader.rs +expression: mod_str +--- +; ModuleID = 'test_context' +source_filename = "test_context" + +@argument_test_int.B1383B8E.0 = private constant [9 x i8] c"\08test_int" + +define internal i64 @_hl.main.1() !dbg !3 { +alloca_block: + %"0" = alloca i64, align 8 + %"4_0" = alloca i64, align 8 + br label %entry_block + +entry_block: ; preds = %alloca_block + %read_arg_int = call i64 @argreader_get_i64(ptr @argument_test_int.B1383B8E.0), !dbg !8 + store i64 %read_arg_int, ptr %"4_0", align 4, !dbg !8 + %"4_01" = load i64, ptr %"4_0", align 4 + store i64 %"4_01", ptr %"0", align 4 + %"02" = load i64, ptr %"0", align 4 + ret i64 %"02" +} + +declare i64 @argreader_get_i64(ptr) + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "hugr_llvm_test", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "/lPNzlV/ClAphFG/yrhvZs/eDgUn/eIVwAutKJHaZEPSZwPXPeycUvnujGxZ") +!3 = distinct !DISubprogram(name: "_hl.main.1", linkageName: "_hl.main.1", scope: null, file: !4, line: 25254, type: !5, scopeLine: 25255, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") +!5 = !DISubroutineType(types: !6) +!6 = !{!7} +!7 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!8 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_3.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_3.snap new file mode 100644 index 000000000..1fa0cbd8c --- /dev/null +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_3.snap @@ -0,0 +1,38 @@ +--- +source: tket-qsystem/src/llvm/argreader.rs +expression: mod_str +--- +; ModuleID = 'test_context' +source_filename = "test_context" + +@argument_test_f64.30E2B5C9.0 = private constant [9 x i8] c"\08test_f64" + +define internal double @_hl.main.1() !dbg !3 { +alloca_block: + %"0" = alloca double, align 8 + %"4_0" = alloca double, align 8 + br label %entry_block + +entry_block: ; preds = %alloca_block + %read_arg_f64 = call double @argreader_get_f64(ptr @argument_test_f64.30E2B5C9.0), !dbg !8 + store double %read_arg_f64, ptr %"4_0", align 8, !dbg !8 + %"4_01" = load double, ptr %"4_0", align 8 + store double %"4_01", ptr %"0", align 8 + %"02" = load double, ptr %"0", align 8 + ret double %"02" +} + +declare double @argreader_get_f64(ptr) + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "hugr_llvm_test", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "/lPNzlV/ClAphFG/yrhvZs/eDgUn/eIVwAutKJHaZEPSZwPXPeycUvnujGxZ") +!3 = distinct !DISubprogram(name: "_hl.main.1", linkageName: "_hl.main.1", scope: null, file: !4, line: 25254, type: !5, scopeLine: 25255, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") +!5 = !DISubroutineType(types: !6) +!6 = !{!7} +!7 = !DIBasicType(name: "f64", size: 64, encoding: DW_ATE_float) +!8 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_4.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_4.snap new file mode 100644 index 000000000..34af15320 --- /dev/null +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_4.snap @@ -0,0 +1,55 @@ +--- +source: tket-qsystem/src/llvm/argreader.rs +expression: mod_str +--- +; ModuleID = 'test_context' +source_filename = "test_context" + +@argument_test_arr_b.A74DBE76.0 = private constant [14 x i8] c"\0Dtest_arr_bool" + +define internal { ptr, ptr, i64 } @_hl.main.1() !dbg !3 { +alloca_block: + %"0" = alloca { ptr, ptr, i64 }, align 8 + %"4_0" = alloca { ptr, ptr, i64 }, align 8 + br label %entry_block + +entry_block: ; preds = %alloca_block + %array_size = mul i64 10, ptrtoint (ptr getelementptr (i1, ptr null, i32 1) to i64), !dbg !11 + %0 = call ptr @malloc(i64 %array_size), !dbg !11 + %1 = call ptr @malloc(i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64)), !dbg !11 + call void @llvm.memset.p0.i64(ptr %1, i8 0, i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), i1 false), !dbg !11 + %2 = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0, !dbg !11 + %3 = insertvalue { ptr, ptr, i64 } %2, ptr %1, 1, !dbg !11 + %4 = insertvalue { ptr, ptr, i64 } %3, i64 0, 2, !dbg !11 + call void @argreader_get_bool_array(ptr @argument_test_arr_b.A74DBE76.0, ptr %0, i64 10), !dbg !11 + store { ptr, ptr, i64 } %4, ptr %"4_0", align 8, !dbg !11 + %"4_01" = load { ptr, ptr, i64 }, ptr %"4_0", align 8 + store { ptr, ptr, i64 } %"4_01", ptr %"0", align 8 + %"02" = load { ptr, ptr, i64 }, ptr %"0", align 8 + ret { ptr, ptr, i64 } %"02" +} + +declare void @argreader_get_bool_array(ptr, ptr, i64) + +declare ptr @malloc(i64) + +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 + +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "hugr_llvm_test", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "/lPNzlV/ClAphFG/yrhvZs/eDgUn/eIVwAutKJHaZEPSZwPXPeycUvnujGxZ") +!3 = distinct !DISubprogram(name: "_hl.main.1", linkageName: "_hl.main.1", scope: null, file: !4, line: 25254, type: !5, scopeLine: 25255, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") +!5 = !DISubroutineType(types: !6) +!6 = !{!7} +!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !8) +!8 = !{!9, !9, !10} +!9 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) +!10 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!11 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_5.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_5.snap new file mode 100644 index 000000000..6bd08c48d --- /dev/null +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_5.snap @@ -0,0 +1,55 @@ +--- +source: tket-qsystem/src/llvm/argreader.rs +expression: mod_str +--- +; ModuleID = 'test_context' +source_filename = "test_context" + +@argument_test_arr_i.EF2BFDB2.0 = private constant [13 x i8] c"\0Ctest_arr_int" + +define internal { ptr, ptr, i64 } @_hl.main.1() !dbg !3 { +alloca_block: + %"0" = alloca { ptr, ptr, i64 }, align 8 + %"4_0" = alloca { ptr, ptr, i64 }, align 8 + br label %entry_block + +entry_block: ; preds = %alloca_block + %array_size = mul i64 10, ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), !dbg !11 + %0 = call ptr @malloc(i64 %array_size), !dbg !11 + %1 = call ptr @malloc(i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64)), !dbg !11 + call void @llvm.memset.p0.i64(ptr %1, i8 0, i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), i1 false), !dbg !11 + %2 = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0, !dbg !11 + %3 = insertvalue { ptr, ptr, i64 } %2, ptr %1, 1, !dbg !11 + %4 = insertvalue { ptr, ptr, i64 } %3, i64 0, 2, !dbg !11 + call void @argreader_get_i64_array(ptr @argument_test_arr_i.EF2BFDB2.0, ptr %0, i64 10), !dbg !11 + store { ptr, ptr, i64 } %4, ptr %"4_0", align 8, !dbg !11 + %"4_01" = load { ptr, ptr, i64 }, ptr %"4_0", align 8 + store { ptr, ptr, i64 } %"4_01", ptr %"0", align 8 + %"02" = load { ptr, ptr, i64 }, ptr %"0", align 8 + ret { ptr, ptr, i64 } %"02" +} + +declare void @argreader_get_i64_array(ptr, ptr, i64) + +declare ptr @malloc(i64) + +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 + +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "hugr_llvm_test", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "/lPNzlV/ClAphFG/yrhvZs/eDgUn/eIVwAutKJHaZEPSZwPXPeycUvnujGxZ") +!3 = distinct !DISubprogram(name: "_hl.main.1", linkageName: "_hl.main.1", scope: null, file: !4, line: 25254, type: !5, scopeLine: 25255, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") +!5 = !DISubroutineType(types: !6) +!6 = !{!7} +!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !8) +!8 = !{!9, !9, !10} +!9 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) +!10 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!11 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_6.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_6.snap new file mode 100644 index 000000000..550fdcb0a --- /dev/null +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_6.snap @@ -0,0 +1,55 @@ +--- +source: tket-qsystem/src/llvm/argreader.rs +expression: mod_str +--- +; ModuleID = 'test_context' +source_filename = "test_context" + +@argument_test_arr_f.A22F4976.0 = private constant [13 x i8] c"\0Ctest_arr_f64" + +define internal { ptr, ptr, i64 } @_hl.main.1() !dbg !3 { +alloca_block: + %"0" = alloca { ptr, ptr, i64 }, align 8 + %"4_0" = alloca { ptr, ptr, i64 }, align 8 + br label %entry_block + +entry_block: ; preds = %alloca_block + %array_size = mul i64 10, ptrtoint (ptr getelementptr (double, ptr null, i32 1) to i64), !dbg !11 + %0 = call ptr @malloc(i64 %array_size), !dbg !11 + %1 = call ptr @malloc(i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64)), !dbg !11 + call void @llvm.memset.p0.i64(ptr %1, i8 0, i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), i1 false), !dbg !11 + %2 = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0, !dbg !11 + %3 = insertvalue { ptr, ptr, i64 } %2, ptr %1, 1, !dbg !11 + %4 = insertvalue { ptr, ptr, i64 } %3, i64 0, 2, !dbg !11 + call void @argreader_get_f64_array(ptr @argument_test_arr_f.A22F4976.0, ptr %0, i64 10), !dbg !11 + store { ptr, ptr, i64 } %4, ptr %"4_0", align 8, !dbg !11 + %"4_01" = load { ptr, ptr, i64 }, ptr %"4_0", align 8 + store { ptr, ptr, i64 } %"4_01", ptr %"0", align 8 + %"02" = load { ptr, ptr, i64 }, ptr %"0", align 8 + ret { ptr, ptr, i64 } %"02" +} + +declare void @argreader_get_f64_array(ptr, ptr, i64) + +declare ptr @malloc(i64) + +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 + +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } + +!llvm.module.flags = !{!0} +!llvm.dbg.cu = !{!1} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = distinct !DICompileUnit(language: DW_LANG_Python, file: !2, producer: "hugr_llvm_test", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +!2 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "/lPNzlV/ClAphFG/yrhvZs/eDgUn/eIVwAutKJHaZEPSZwPXPeycUvnujGxZ") +!3 = distinct !DISubprogram(name: "_hl.main.1", linkageName: "_hl.main.1", scope: null, file: !4, line: 25254, type: !5, scopeLine: 25255, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1) +!4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") +!5 = !DISubroutineType(types: !6) +!6 = !{!7} +!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !8) +!8 = !{!9, !9, !10} +!9 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) +!10 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) +!11 = !DILocation(line: 27062, column: 402, scope: !3) From 7ffa7523c0a35a1d5ff84b4b16eefe7ecf4e5d24 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Fri, 19 Jun 2026 15:29:06 +0100 Subject: [PATCH 3/6] Ship tket.argreader extension via tket_exts - Add argreader::EXTENSION to qsystem_extensions() so it is serialized - Regenerate tket-exts/src/tket_exts/data/tket/argreader.json - Add ArgReaderExtension Python wrapper with read_arg() helper - Register argreader in tket_exts __init__ and tket_registry() - Add validation test fixture for the argreader extension Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tket-exts/src/tket_exts/__init__.py | 4 ++ .../src/tket_exts/data/tket/argreader.json | 34 +++++++++++++ tket-exts/src/tket_exts/tket/__init__.py | 2 + tket-exts/src/tket_exts/tket/argreader.py | 50 +++++++++++++++++++ tket-exts/tests/test_validate_exts.py | 10 ++++ tket-qsystem/src/extension.rs | 3 +- 6 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 tket-exts/src/tket_exts/data/tket/argreader.json create mode 100644 tket-exts/src/tket_exts/tket/argreader.py diff --git a/tket-exts/src/tket_exts/__init__.py b/tket-exts/src/tket_exts/__init__.py index 07089f78b..8525fde3a 100644 --- a/tket-exts/src/tket_exts/__init__.py +++ b/tket-exts/src/tket_exts/__init__.py @@ -19,6 +19,7 @@ from tket_exts.tket.result import ResultExtension from tket_exts.tket.wasm import WasmExtension from tket_exts.tket.measurement import MeasurementExtension +from tket_exts.tket.argreader import ArgReaderExtension from hugr.ext import ExtensionRegistry from tket_exts import tket @@ -45,6 +46,7 @@ "global_phase", "globals", "measurement", + "argreader", ] debug: DebugExtension = tket.debug.DebugExtension() @@ -64,6 +66,7 @@ global_phase: GlobalPhaseExtension = tket.global_phase.GlobalPhaseExtension() globals: GlobalsExtension = tket.globals.GlobalsExtension() measurement: MeasurementExtension = tket.measurement.MeasurementExtension() +argreader: ArgReaderExtension = tket.argreader.ArgReaderExtension() def tket_registry() -> ExtensionRegistry: @@ -92,6 +95,7 @@ def tket_registry() -> ExtensionRegistry: tket.modifier.ModifierExtension(), tket.global_phase.GlobalPhaseExtension(), tket.measurement.MeasurementExtension(), + tket.argreader.ArgReaderExtension(), ] registry = ExtensionRegistry() diff --git a/tket-exts/src/tket_exts/data/tket/argreader.json b/tket-exts/src/tket_exts/data/tket/argreader.json new file mode 100644 index 000000000..f03d9668d --- /dev/null +++ b/tket-exts/src/tket_exts/data/tket/argreader.json @@ -0,0 +1,34 @@ +{ + "version": "0.1.0", + "name": "tket.argreader", + "types": {}, + "operations": { + "read_arg": { + "extension": "tket.argreader", + "name": "read_arg", + "description": "Read a runtime argument of the given type identified by a string tag", + "signature": { + "params": [ + { + "tp": "String" + }, + { + "tp": "Type", + "b": "A" + } + ], + "body": { + "input": [], + "output": [ + { + "t": "V", + "i": 1, + "b": "A" + } + ] + } + }, + "binary": false + } + } +} diff --git a/tket-exts/src/tket_exts/tket/__init__.py b/tket-exts/src/tket_exts/tket/__init__.py index f31b2f04a..fd78a3775 100644 --- a/tket-exts/src/tket_exts/tket/__init__.py +++ b/tket-exts/src/tket_exts/tket/__init__.py @@ -13,6 +13,7 @@ modifier, global_phase, globals, + argreader, ) __all__ = [ @@ -30,4 +31,5 @@ "modifier", "global_phase", "globals", + "argreader", ] diff --git a/tket-exts/src/tket_exts/tket/argreader.py b/tket-exts/src/tket_exts/tket/argreader.py new file mode 100644 index 000000000..ff361dc23 --- /dev/null +++ b/tket-exts/src/tket_exts/tket/argreader.py @@ -0,0 +1,50 @@ +"""Argument reader extension operations.""" + +import functools +from typing import List + +from hugr.ext import Extension, OpDef, TypeDef +from hugr.ops import ExtOp +from hugr.tys import FunctionType, StringArg, Type, TypeTypeArg + +from ._util import TketExtension, load_extension + + +class ArgReaderExtension(TketExtension): + """Operations for reading runtime entrypoint arguments.""" + + @functools.cache + def __call__(self) -> Extension: + """Returns the argreader extension""" + return load_extension("tket.argreader") + + def TYPES(self) -> List[TypeDef]: + """Return the types defined by this extension""" + return [] + + def OPS(self) -> List[OpDef]: + """Return the operations defined by this extension""" + return [ + self.read_arg_def, + ] + + @functools.cached_property + def read_arg_def(self) -> OpDef: + """Read a runtime argument of the given type identified by a string tag. + + This is the generic operation definition. For the instantiated operation, see + `read_arg`. + """ + return self().get_op("read_arg") + + def read_arg(self, tag: str, ty: Type) -> ExtOp: + """Read a runtime argument of type ``ty`` identified by ``tag``. + + Args: + tag: String tag identifying the argument (matches the provider's key). + ty: The HUGR type of the argument to read. + """ + return self.read_arg_def.instantiate( + [StringArg(tag), TypeTypeArg(ty)], + FunctionType(input=[], output=[ty]), + ) diff --git a/tket-exts/tests/test_validate_exts.py b/tket-exts/tests/test_validate_exts.py index 5a4056651..ba2ef57f6 100644 --- a/tket-exts/tests/test_validate_exts.py +++ b/tket-exts/tests/test_validate_exts.py @@ -218,6 +218,15 @@ def ext_wasm() -> Tuple[TketExtension, List[ExtType], List[ExtOp]]: ) +def ext_argreader() -> Tuple[TketExtension, List[ExtType], List[ExtOp]]: + ext = tket_exts.argreader + return ( + ext, + [], + [ext.read_arg("test", Bool)], + ) + + @pytest.mark.parametrize( "ext_vals", [ @@ -235,6 +244,7 @@ def ext_wasm() -> Tuple[TketExtension, List[ExtType], List[ExtOp]]: ext_result, ext_rotation, ext_wasm, + ext_argreader, ], ) def test_exported_extension( diff --git a/tket-qsystem/src/extension.rs b/tket-qsystem/src/extension.rs index 9dd1f3b97..1cfb7ed82 100644 --- a/tket-qsystem/src/extension.rs +++ b/tket-qsystem/src/extension.rs @@ -30,7 +30,7 @@ pub static REGISTRY: LazyLock = LazyLock::new(|| { /// The list intentionally excludes std and base tket extensions so callers can /// combine it with [`tket::extension::tket_extensions`] or another base /// registry without duplicating either list. -pub fn qsystem_extensions() -> [Arc; 10] { +pub fn qsystem_extensions() -> [Arc; 11] { [ gpu::EXTENSION.to_owned(), qsystem::EXTENSION.to_owned(), @@ -42,5 +42,6 @@ pub fn qsystem_extensions() -> [Arc; 10] { utils::EXTENSION.to_owned(), wasm::EXTENSION.to_owned(), globals::EXTENSION.to_owned(), + argreader::EXTENSION.to_owned(), ] } From 073d99f288547fe7c850e3d415992ac69f96f4f7 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Fri, 19 Jun 2026 17:18:28 +0100 Subject: [PATCH 4/6] refactor: argreader classification in llvm module with robust type-casting Move ArgKind, classify_arg_type and the scalar/array classification helpers out of the HUGR extension definition and into the LLVM lowering module, since classification is purely a codegen concern. - Identify types via full Type comparison against the canonical tables (INT_TYPES, bool_t, float64_type) and the borrow_array TypeDef, instead of flakily matching on bare extension ids. - Reject integer widths other than i64 (log-width 6) at codegen time, where the get_i64 selene extern is the only integer reader; the extension layer stays permissive about width. - Revert anyhow back to an optional dependency in tket-qsystem, gated by the cli + llvm features, now that the only non-llvm anyhow user has moved. - qis-compiler: enable module.verify() after codegen and validate that the entrypoint has no leftover input parameters (all args must flow through read_arg ops). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- qis-compiler/rust/lib.rs | 4 +- tket-qsystem/Cargo.toml | 6 +- tket-qsystem/src/extension/argreader.rs | 123 +------------ tket-qsystem/src/llvm/argreader.rs | 223 ++++++++++++++++++++++-- 4 files changed, 226 insertions(+), 130 deletions(-) diff --git a/qis-compiler/rust/lib.rs b/qis-compiler/rust/lib.rs index 61f4b01c2..b8ce5f397 100644 --- a/qis-compiler/rust/lib.rs +++ b/qis-compiler/rust/lib.rs @@ -1,7 +1,7 @@ //! The compiler for HUGR to QIS pub mod array; -use anyhow::{Result, anyhow}; +use anyhow::{Result, anyhow, bail}; use hugr::envelope::EnvelopeConfig; use hugr::llvm::CodegenExtsBuilder; use hugr::llvm::custom::CodegenExtsMap; @@ -381,7 +381,7 @@ fn compile<'c, 'hugr: 'c>( if let Some(di_ctx) = maybe_di_ctx.take() { di_ctx.finish(); } - //module.verify().map_err(Into::::into)?; + module.verify().map_err(Into::::into)?; Ok(module) } diff --git a/tket-qsystem/Cargo.toml b/tket-qsystem/Cargo.toml index e1f5ff78d..281e599cc 100644 --- a/tket-qsystem/Cargo.toml +++ b/tket-qsystem/Cargo.toml @@ -15,8 +15,8 @@ categories = ["compilers", "science::quantum-computing"] [features] default = ["cli"] -cli = ["dep:clap", "dep:hugr-cli"] -llvm = ["tket/llvm"] +cli = ["dep:clap", "dep:hugr-cli", "dep:anyhow"] +llvm = ["tket/llvm", "dep:anyhow"] [[bin]] name = "tket-qsystem" @@ -44,7 +44,7 @@ derive_more = { workspace = true, features = [ typetag.workspace = true delegate.workspace = true indexmap.workspace = true -anyhow = { workspace = true } +anyhow = { workspace = true, optional = true } [dev-dependencies] tket1-passes = { path = "../tket1-passes" } diff --git a/tket-qsystem/src/extension/argreader.rs b/tket-qsystem/src/extension/argreader.rs index 85fb6f47b..1358317af 100644 --- a/tket-qsystem/src/extension/argreader.rs +++ b/tket-qsystem/src/extension/argreader.rs @@ -12,17 +12,9 @@ use hugr::{ }, }, ops::OpName, - std_extensions::{ - arithmetic::{float_types, int_types}, - collections::borrow_array, - }, - types::{ - PolyFuncTypeRV, Signature, SumType, Term, Type, TypeArg, TypeBound, - type_param::TypeParam, - }, + types::{PolyFuncTypeRV, Signature, Term, Type, TypeArg, TypeBound, type_param::TypeParam}, }; -use anyhow::{Result, bail}; use lazy_static::lazy_static; use serde::{Deserialize, Serialize}; use strum::{EnumIter, EnumString, IntoStaticStr}; @@ -186,74 +178,14 @@ pub trait ReadArgBuilder: Dataflow { } impl ReadArgBuilder for D {} -/// The concrete variant of an argument type, used to select the selene extern function. -#[derive(Debug, Clone, PartialEq)] -pub enum ArgKind { - /// A boolean argument - Bool, - /// A signed 64-bit integer argument (any int log-width) - Int, - /// A 64-bit floating-point argument - F64, - /// An array of booleans with a fixed length - ArrBool(u64), - /// An array of signed 64-bit integers with a fixed length - ArrInt(u64), - /// An array of 64-bit floats with a fixed length - ArrF64(u64), -} - -/// Classify the concrete output type of a [`ReadArgOp`] into the corresponding -/// selene runtime function variant. -/// -/// Returns an error for types not supported as entrypoint arguments. -pub fn classify_arg_type(ty: &Type) -> Result { - match &**ty { - Term::SumType(SumType::Unit { size: 2 }) => Ok(ArgKind::Bool), - Term::ExtensionType(custom) => { - if *custom.extension() == int_types::EXTENSION_ID { - Ok(ArgKind::Int) - } else if *custom.extension() == float_types::EXTENSION_ID { - Ok(ArgKind::F64) - } else if *custom.extension() == borrow_array::EXTENSION_ID { - match custom.args() { - [TypeArg::BoundedNat(n), elem] => classify_borrow_array_elem(elem, *n), - _ => bail!("Unexpected borrow_array type args: {:?}", custom.args()), - } - } else { - bail!( - "Unsupported extension type for argument reading: {:?}", - custom.extension() - ) - } - } - other => bail!("Unsupported type for argument reading: {:?}", other), - } -} - -fn classify_borrow_array_elem(elem: &Term, len: u64) -> Result { - match elem { - Term::SumType(SumType::Unit { size: 2 }) => Ok(ArgKind::ArrBool(len)), - Term::ExtensionType(e) if *e.extension() == int_types::EXTENSION_ID => { - Ok(ArgKind::ArrInt(len)) - } - Term::ExtensionType(e) if *e.extension() == float_types::EXTENSION_ID => { - Ok(ArgKind::ArrF64(len)) - } - other => bail!( - "Unsupported element type in borrow_array for argument reading: {:?}", - other - ), - } -} - #[cfg(test)] pub(crate) mod test { use super::*; use hugr::extension::prelude::bool_t; use hugr::extension::simple_op::{HasConcrete, MakeRegisteredOp}; - use hugr::std_extensions::arithmetic::{float_types::float64_type, int_types::int_type}; + use hugr::std_extensions::arithmetic::int_types::int_type; use hugr::std_extensions::collections::borrow_array::borrow_array_type; + use hugr::types::TypeArg; fn roundtrip(op: ReadArgOp) -> ReadArgOp { let type_args = op.type_args(); @@ -274,6 +206,7 @@ pub(crate) mod test { #[test] fn test_f64_roundtrip() { + use hugr::std_extensions::arithmetic::float_types::float64_type; let op = ReadArgOp::new("my_f64", float64_type()); assert_eq!(roundtrip(op.clone()), op); } @@ -295,56 +228,18 @@ pub(crate) mod test { #[test] fn test_arr_f64_roundtrip() { + use hugr::std_extensions::arithmetic::float_types::float64_type; let op = ReadArgOp::new("my_arr_f64", borrow_array_type(10, float64_type())); assert_eq!(roundtrip(op.clone()), op); } - #[test] - fn test_classify_bool() { - assert_eq!(classify_arg_type(&bool_t()).unwrap(), ArgKind::Bool); - } - - #[test] - fn test_classify_int() { - assert_eq!( - classify_arg_type(&int_type(TypeArg::BoundedNat(6))).unwrap(), - ArgKind::Int - ); - } - - #[test] - fn test_classify_f64() { - assert_eq!(classify_arg_type(&float64_type()).unwrap(), ArgKind::F64); - } - - #[test] - fn test_classify_arr_bool() { - assert_eq!( - classify_arg_type(&borrow_array_type(10, bool_t())).unwrap(), - ArgKind::ArrBool(10) - ); - } - - #[test] - fn test_classify_arr_int() { - assert_eq!( - classify_arg_type(&borrow_array_type(10, int_type(TypeArg::BoundedNat(6)))).unwrap(), - ArgKind::ArrInt(10) - ); - } - - #[test] - fn test_classify_arr_f64() { - assert_eq!( - classify_arg_type(&borrow_array_type(10, float64_type())).unwrap(), - ArgKind::ArrF64(10) - ); - } - #[test] fn test_to_extension_op_roundtrip() { let op = ReadArgOp::new("my_bool", bool_t()); - let ext_op = op.clone().to_extension_op().expect("should build extension op"); + let ext_op = op + .clone() + .to_extension_op() + .expect("should build extension op"); let roundtripped = ReadArgOp::from_extension_op(&ext_op).expect("should decode"); assert_eq!(roundtripped, op); } diff --git a/tket-qsystem/src/llvm/argreader.rs b/tket-qsystem/src/llvm/argreader.rs index 282f61b7d..e78c312f5 100644 --- a/tket-qsystem/src/llvm/argreader.rs +++ b/tket-qsystem/src/llvm/argreader.rs @@ -1,13 +1,22 @@ //! LLVM lowering implementations for the "tket.argreader" extension. -use crate::extension::argreader::{ArgKind, ReadArgOp, ReadArgOpDef, classify_arg_type}; +use crate::extension::argreader::{ReadArgOp, ReadArgOpDef}; use crate::llvm::prelude::emit_global_string; -use anyhow::{Result, bail}; +use anyhow::{Result, anyhow, bail}; +use hugr::extension::prelude::bool_t; use hugr::llvm::CodegenExtsBuilder; use hugr::llvm::custom::CodegenExtension; use hugr::llvm::emit::{EmitFuncContext, EmitOpArgs}; -use hugr::llvm::extension::collections::borrow_array::{self, BorrowArrayCodegen}; +use hugr::llvm::extension::collections::borrow_array::{ + self as llvm_borrow_array, BorrowArrayCodegen, +}; use hugr::llvm::inkwell; +use hugr::std_extensions::arithmetic::float_types::float64_type; +use hugr::std_extensions::arithmetic::int_types::{INT_TYPES, LOG_WIDTH_MAX}; +use hugr::std_extensions::collections::borrow_array::{ + EXTENSION_ID as BORROW_ARRAY_EXTENSION_ID, borrow_array_type_def, +}; +use hugr::types::{Term, Type, TypeArg}; use inkwell::AddressSpace; use inkwell::builder::Builder; use inkwell::context::Context; @@ -17,6 +26,123 @@ use tket::hugr::extension::simple_op::MakeExtensionOp; use tket::hugr::ops::ExtensionOp; use tket::hugr::{HugrView, Node}; +/// The concrete variant of an argument type, used to select the selene extern function. +/// +/// Produced by [`classify_arg_type`]; lives here because it is purely a codegen concept. +#[derive(Debug, Clone, PartialEq)] +enum ArgKind { + /// A boolean argument. + Bool, + /// A signed 64-bit integer argument (i64 / log-width 6 only). + Int, + /// A 64-bit floating-point argument. + F64, + /// An array of booleans with a fixed length. + ArrBool(u64), + /// An array of signed 64-bit integers with a fixed length. + ArrInt(u64), + /// An array of 64-bit floats with a fixed length. + ArrF64(u64), +} + +/// A leaf (non-array) argument type, identifying the corresponding selene extern. +#[derive(Debug, Clone, Copy, PartialEq)] +enum Scalar { + Bool, + Int, + F64, +} + +impl Scalar { + const fn scalar_kind(self) -> ArgKind { + match self { + Scalar::Bool => ArgKind::Bool, + Scalar::Int => ArgKind::Int, + Scalar::F64 => ArgKind::F64, + } + } + + const fn array_kind(self, size: u64) -> ArgKind { + match self { + Scalar::Bool => ArgKind::ArrBool(size), + Scalar::Int => ArgKind::ArrInt(size), + Scalar::F64 => ArgKind::ArrF64(size), + } + } +} + +/// If `ty` is a HUGR integer type, return its log-width. +/// +/// Compares against the canonical [`INT_TYPES`] table rather than just the extension +/// id, so it cannot be confused with another type from the same extension. +fn as_int_log_width(ty: &Type) -> Option { + INT_TYPES + .iter() + .position(|int_ty| int_ty == ty) + .map(|w| w as u8) +} + +/// If `ty` is a `borrow_array`, return its `(size, element type)`. +/// +/// Verifies both the extension id and the type name against the canonical type def, +/// and recovers the element type via [`Type::try_from`]. +fn as_borrow_array(ty: &Type) -> Option<(u64, Type)> { + let Term::ExtensionType(custom) = &**ty else { + return None; + }; + if *custom.extension() != BORROW_ARRAY_EXTENSION_ID + || custom.name() != borrow_array_type_def().name() + { + return None; + } + match custom.args() { + [TypeArg::BoundedNat(size), elem] => { + Type::try_from(elem.clone()).ok().map(|elem| (*size, elem)) + } + _ => None, + } +} + +/// Classify a scalar (non-array) argument type. +/// +/// Returns `None` if `ty` is not a supported scalar shape, or `Some(Err(..))` if it is +/// recognisably an integer but not the supported i64 width (`argreader_get_i64` is the +/// only integer extern, so narrower widths must be rejected at codegen time). +fn classify_scalar(ty: &Type) -> Option> { + if *ty == bool_t() { + Some(Ok(Scalar::Bool)) + } else if *ty == float64_type() { + Some(Ok(Scalar::F64)) + } else { + as_int_log_width(ty).map(|log_width| { + if log_width == LOG_WIDTH_MAX { + Ok(Scalar::Int) + } else { + Err(anyhow!( + "Only i64 (log-width {LOG_WIDTH_MAX}) is supported as an integer argument; \ + got log-width {log_width}" + )) + } + }) + } +} + +/// Map the concrete output type of a [`ReadArgOp`] to the selene extern function variant. +/// +/// Errors on unsupported types, including integer types other than i64. +fn classify_arg_type(ty: &Type) -> Result { + if let Some(scalar) = classify_scalar(ty) { + return scalar.map(Scalar::scalar_kind); + } + if let Some((size, elem)) = as_borrow_array(ty) { + return match classify_scalar(&elem) { + Some(scalar) => scalar.map(|s| s.array_kind(size)), + None => bail!("Unsupported borrow_array element type for argument reading: {elem}"), + }; + } + bail!("Unsupported type for argument reading: {ty}") +} + /// Codegen extension for the argreader #[derive(Default)] pub struct ArgReaderCodegenExtension { @@ -134,11 +260,7 @@ impl<'c, H: HugrView, BAC: BorrowArrayCodegen + Clone> self.0.get_extern_func(func_name, fn_type) } - fn emit( - &mut self, - args: EmitOpArgs<'c, '_, ExtensionOp, H>, - op: &ReadArgOp, - ) -> Result<()> { + fn emit(&mut self, args: EmitOpArgs<'c, '_, ExtensionOp, H>, op: &ReadArgOp) -> Result<()> { if op.tag.is_empty() { bail!("Empty argument name tag received"); } @@ -201,7 +323,7 @@ impl<'c, H: HugrView, BAC: BorrowArrayCodegen + Clone> } let len_val = self.i64_t().const_int(len, false); let (elems_ptr, barray_value) = - borrow_array::build_barray_alloc(self.0, &self.1, elem_ty, len, false)?; + llvm_borrow_array::build_barray_alloc(self.0, &self.1, elem_ty, len, false)?; self.builder().build_call( argread_fn, &[tag_ptr.into(), elems_ptr.into(), len_val.into()], @@ -234,10 +356,29 @@ mod test { #[case::int(2, ReadArgOp::new("test_int", int_type(TypeArg::BoundedNat(6))))] #[case::f64(3, ReadArgOp::new("test_f64", float64_type()))] #[case::arr_bool(4, ReadArgOp::new("test_arr_bool", borrow_array_type(10, bool_t())))] - #[case::arr_int(5, ReadArgOp::new("test_arr_int", borrow_array_type(10, int_type(TypeArg::BoundedNat(6)))))] - #[case::arr_f64(6, ReadArgOp::new("test_arr_f64", borrow_array_type(10, float64_type())))] + #[case::arr_int( + 5, + ReadArgOp::new( + "test_arr_int", + borrow_array_type(10, int_type(TypeArg::BoundedNat(6))) + ) + )] + #[case::arr_f64( + 6, + ReadArgOp::new("test_arr_f64", borrow_array_type(10, float64_type())) + )] #[should_panic(expected = "Empty argument name tag received")] #[case::empty_tag(7, ReadArgOp::new("", bool_t()))] + #[should_panic(expected = "log-width 6")] + #[case::narrow_int(8, ReadArgOp::new("test_narrow", int_type(TypeArg::BoundedNat(3))))] + #[should_panic(expected = "log-width 6")] + #[case::narrow_int_arr( + 9, + ReadArgOp::new( + "test_narrow_arr", + borrow_array_type(4, int_type(TypeArg::BoundedNat(3))) + ) + )] fn emit_argreader_codegen( #[case] _i: i32, #[with(_i)] mut llvm_ctx: TestContext, @@ -256,4 +397,64 @@ mod test { let mut hugr = single_op_hugr(ext_op); check_emission!(hugr, llvm_ctx); } + + #[test] + fn test_classify_bool() { + assert_eq!(classify_arg_type(&bool_t()).unwrap(), ArgKind::Bool); + } + + #[test] + fn test_classify_int_i64() { + assert_eq!( + classify_arg_type(&int_type(TypeArg::BoundedNat(6))).unwrap(), + ArgKind::Int + ); + } + + #[test] + fn test_classify_int_rejects_narrow() { + for log_width in 0u64..=5 { + let err = classify_arg_type(&int_type(TypeArg::BoundedNat(log_width))).unwrap_err(); + assert!( + err.to_string().contains("log-width 6"), + "log_width={log_width}: {err}" + ); + } + } + + #[test] + fn test_classify_f64() { + assert_eq!(classify_arg_type(&float64_type()).unwrap(), ArgKind::F64); + } + + #[test] + fn test_classify_arr_bool() { + assert_eq!( + classify_arg_type(&borrow_array_type(10, bool_t())).unwrap(), + ArgKind::ArrBool(10) + ); + } + + #[test] + fn test_classify_arr_int_i64() { + assert_eq!( + classify_arg_type(&borrow_array_type(10, int_type(TypeArg::BoundedNat(6)))).unwrap(), + ArgKind::ArrInt(10) + ); + } + + #[test] + fn test_classify_arr_int_rejects_narrow() { + let err = + classify_arg_type(&borrow_array_type(4, int_type(TypeArg::BoundedNat(3)))).unwrap_err(); + assert!(err.to_string().contains("log-width 6"), "{err}"); + } + + #[test] + fn test_classify_arr_f64() { + assert_eq!( + classify_arg_type(&borrow_array_type(10, float64_type())).unwrap(), + ArgKind::ArrF64(10) + ); + } } From 974a61591fa0c3eeb93e16a6f52e45272a99f2d6 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Mon, 22 Jun 2026 11:19:47 +0100 Subject: [PATCH 5/6] minor cleanups --- tket-qsystem/src/extension/argreader.rs | 49 ++------ tket-qsystem/src/llvm/argreader.rs | 148 +++++++++++------------- 2 files changed, 76 insertions(+), 121 deletions(-) diff --git a/tket-qsystem/src/extension/argreader.rs b/tket-qsystem/src/extension/argreader.rs index 1358317af..46d613bb2 100644 --- a/tket-qsystem/src/extension/argreader.rs +++ b/tket-qsystem/src/extension/argreader.rs @@ -183,53 +183,26 @@ pub(crate) mod test { use super::*; use hugr::extension::prelude::bool_t; use hugr::extension::simple_op::{HasConcrete, MakeRegisteredOp}; + use hugr::std_extensions::arithmetic::float_types::float64_type; use hugr::std_extensions::arithmetic::int_types::int_type; use hugr::std_extensions::collections::borrow_array::borrow_array_type; use hugr::types::TypeArg; + use rstest::rstest; fn roundtrip(op: ReadArgOp) -> ReadArgOp { let type_args = op.type_args(); ReadArgOpDef::ReadArg.instantiate(&type_args).unwrap() } - #[test] - fn test_bool_roundtrip() { - let op = ReadArgOp::new("my_bool", bool_t()); - assert_eq!(roundtrip(op.clone()), op); - } - - #[test] - fn test_int_roundtrip() { - let op = ReadArgOp::new("my_int", int_type(TypeArg::BoundedNat(6))); - assert_eq!(roundtrip(op.clone()), op); - } - - #[test] - fn test_f64_roundtrip() { - use hugr::std_extensions::arithmetic::float_types::float64_type; - let op = ReadArgOp::new("my_f64", float64_type()); - assert_eq!(roundtrip(op.clone()), op); - } - - #[test] - fn test_arr_bool_roundtrip() { - let op = ReadArgOp::new("my_arr_bool", borrow_array_type(10, bool_t())); - assert_eq!(roundtrip(op.clone()), op); - } - - #[test] - fn test_arr_int_roundtrip() { - let op = ReadArgOp::new( - "my_arr_int", - borrow_array_type(10, int_type(TypeArg::BoundedNat(6))), - ); - assert_eq!(roundtrip(op.clone()), op); - } - - #[test] - fn test_arr_f64_roundtrip() { - use hugr::std_extensions::arithmetic::float_types::float64_type; - let op = ReadArgOp::new("my_arr_f64", borrow_array_type(10, float64_type())); + #[rstest] + #[case("my_bool", bool_t())] + #[case("my_int", int_type(TypeArg::BoundedNat(6)))] + #[case("my_f64", float64_type())] + #[case("my_arr_bool", borrow_array_type(10, bool_t()))] + #[case("my_arr_int", borrow_array_type(10, int_type(TypeArg::BoundedNat(6))))] + #[case("my_arr_f64", borrow_array_type(10, float64_type()))] + fn test_roundtrip(#[case] tag: &str, #[case] output_type: Type) { + let op = ReadArgOp::new(tag, output_type); assert_eq!(roundtrip(op.clone()), op); } diff --git a/tket-qsystem/src/llvm/argreader.rs b/tket-qsystem/src/llvm/argreader.rs index e78c312f5..09286ebdf 100644 --- a/tket-qsystem/src/llvm/argreader.rs +++ b/tket-qsystem/src/llvm/argreader.rs @@ -26,7 +26,7 @@ use tket::hugr::extension::simple_op::MakeExtensionOp; use tket::hugr::ops::ExtensionOp; use tket::hugr::{HugrView, Node}; -/// The concrete variant of an argument type, used to select the selene extern function. +/// The concrete variant of an argument type, used to select the extern function. /// /// Produced by [`classify_arg_type`]; lives here because it is purely a codegen concept. #[derive(Debug, Clone, PartialEq)] @@ -45,7 +45,31 @@ enum ArgKind { ArrF64(u64), } -/// A leaf (non-array) argument type, identifying the corresponding selene extern. +impl ArgKind { + /// The LLVM IR call-instruction name for this kind. + const fn call_name(&self) -> &'static str { + match self { + ArgKind::Bool => "read_arg_bool", + ArgKind::Int => "read_arg_int", + ArgKind::F64 => "read_arg_f64", + ArgKind::ArrBool(_) => "read_arg_bool_array", + ArgKind::ArrInt(_) => "read_arg_int_array", + ArgKind::ArrF64(_) => "read_arg_f64_array", + } + } + + /// If this is an array kind, return `(length, element scalar)`. + const fn as_array(&self) -> Option<(u64, Scalar)> { + match self { + ArgKind::ArrBool(len) => Some((*len, Scalar::Bool)), + ArgKind::ArrInt(len) => Some((*len, Scalar::Int)), + ArgKind::ArrF64(len) => Some((*len, Scalar::F64)), + _ => None, + } + } +} + +/// A leaf (non-array) argument type, identifying the corresponding extern. #[derive(Debug, Clone, Copy, PartialEq)] enum Scalar { Bool, @@ -69,6 +93,15 @@ impl Scalar { Scalar::F64 => ArgKind::ArrF64(size), } } + + /// The LLVM basic type for this scalar. + fn llvm_type<'c>(self, ctx: &'c Context) -> BasicTypeEnum<'c> { + match self { + Scalar::Bool => ctx.bool_type().as_basic_type_enum(), + Scalar::Int => ctx.i64_type().as_basic_type_enum(), + Scalar::F64 => ctx.f64_type().as_basic_type_enum(), + } + } } /// If `ty` is a HUGR integer type, return its log-width. @@ -127,20 +160,20 @@ fn classify_scalar(ty: &Type) -> Option> { } } -/// Map the concrete output type of a [`ReadArgOp`] to the selene extern function variant. +/// Map the concrete output type of a [`ReadArgOp`] to the extern function variant. /// /// Errors on unsupported types, including integer types other than i64. fn classify_arg_type(ty: &Type) -> Result { if let Some(scalar) = classify_scalar(ty) { - return scalar.map(Scalar::scalar_kind); - } - if let Some((size, elem)) = as_borrow_array(ty) { - return match classify_scalar(&elem) { + scalar.map(Scalar::scalar_kind) + } else if let Some((size, elem)) = as_borrow_array(ty) { + match classify_scalar(&elem) { Some(scalar) => scalar.map(|s| s.array_kind(size)), None => bail!("Unsupported borrow_array element type for argument reading: {elem}"), - }; + } + } else { + bail!("Unsupported type for argument reading: {ty}"); } - bail!("Unsupported type for argument reading: {ty}") } /// Codegen extension for the argreader @@ -267,44 +300,21 @@ impl<'c, H: HugrView, BAC: BorrowArrayCodegen + Clone> let kind = classify_arg_type(&op.output_type)?; let argread_fn = self.get_argreader_func(&kind)?; let tag_ptr = emit_global_string(self.0, &op.tag, "argument_", "")?; + let call_name = kind.call_name(); - let result = match kind { - ArgKind::Bool => self - .builder() - .build_call(argread_fn, &[tag_ptr.into()], "read_arg_bool")? - .try_as_basic_value() - .unwrap_basic(), - ArgKind::Int => self - .builder() - .build_call(argread_fn, &[tag_ptr.into()], "read_arg_int")? - .try_as_basic_value() - .unwrap_basic(), - ArgKind::F64 => self - .builder() - .build_call(argread_fn, &[tag_ptr.into()], "read_arg_f64")? - .try_as_basic_value() - .unwrap_basic(), - ArgKind::ArrBool(len) => self.emit_array_read( - argread_fn, - tag_ptr, - len, - self.bool_t().as_basic_type_enum(), - "read_arg_bool_array", - )?, - ArgKind::ArrInt(len) => self.emit_array_read( + let result = if let Some((len, scalar)) = kind.as_array() { + self.emit_array_read( argread_fn, tag_ptr, len, - self.i64_t().as_basic_type_enum(), - "read_arg_int_array", - )?, - ArgKind::ArrF64(len) => self.emit_array_read( - argread_fn, - tag_ptr, - len, - self.f64_t().as_basic_type_enum(), - "read_arg_f64_array", - )?, + scalar.llvm_type(self.iw_context()), + call_name, + )? + } else { + self.builder() + .build_call(argread_fn, &[tag_ptr.into()], call_name)? + .try_as_basic_value() + .unwrap_basic() }; args.outputs.finish(self.builder(), [result]) @@ -398,17 +408,18 @@ mod test { check_emission!(hugr, llvm_ctx); } - #[test] - fn test_classify_bool() { - assert_eq!(classify_arg_type(&bool_t()).unwrap(), ArgKind::Bool); - } - - #[test] - fn test_classify_int_i64() { - assert_eq!( - classify_arg_type(&int_type(TypeArg::BoundedNat(6))).unwrap(), - ArgKind::Int - ); + #[rstest] + #[case::bool(bool_t(), ArgKind::Bool)] + #[case::int(int_type(TypeArg::BoundedNat(6)), ArgKind::Int)] + #[case::f64(float64_type(), ArgKind::F64)] + #[case::arr_bool(borrow_array_type(10, bool_t()), ArgKind::ArrBool(10))] + #[case::arr_int( + borrow_array_type(10, int_type(TypeArg::BoundedNat(6))), + ArgKind::ArrInt(10) + )] + #[case::arr_f64(borrow_array_type(10, float64_type()), ArgKind::ArrF64(10))] + fn test_classify(#[case] ty: Type, #[case] expected: ArgKind) { + assert_eq!(classify_arg_type(&ty).unwrap(), expected); } #[test] @@ -422,39 +433,10 @@ mod test { } } - #[test] - fn test_classify_f64() { - assert_eq!(classify_arg_type(&float64_type()).unwrap(), ArgKind::F64); - } - - #[test] - fn test_classify_arr_bool() { - assert_eq!( - classify_arg_type(&borrow_array_type(10, bool_t())).unwrap(), - ArgKind::ArrBool(10) - ); - } - - #[test] - fn test_classify_arr_int_i64() { - assert_eq!( - classify_arg_type(&borrow_array_type(10, int_type(TypeArg::BoundedNat(6)))).unwrap(), - ArgKind::ArrInt(10) - ); - } - #[test] fn test_classify_arr_int_rejects_narrow() { let err = classify_arg_type(&borrow_array_type(4, int_type(TypeArg::BoundedNat(3)))).unwrap_err(); assert!(err.to_string().contains("log-width 6"), "{err}"); } - - #[test] - fn test_classify_arr_f64() { - assert_eq!( - classify_arg_type(&borrow_array_type(10, float64_type())).unwrap(), - ArgKind::ArrF64(10) - ); - } } From 3c06d0c74473f0c4f0587cc0cd0619896449c8b3 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Mon, 22 Jun 2026 11:52:20 +0100 Subject: [PATCH 6/6] refactor: argreader reads standard arrays via ArrayLowering Mirror the result/debug codegen by making argreader operate on the standard `array` type through the existing `ArrayLowering` abstraction, instead of being hard-wired to `borrow_array`. - Add `alloc_array` to the `ArrayLowering` trait (argreader produces arrays, whereas result only consumes them) and implement it for `HeapArrayLowering` via `array::build_array_alloc`. - Make `ArgReaderCodegenExtension` generic over `AL: ArrayLowering`; allocate + wrap the extern-filled buffer with `alloc_array` + `array_from_ptr`. - Classify the standard `array` typedef (`as_borrow_array` -> `as_std_array`). - Wire argreader with `SeleneHeapArrayCodegen::LOWERING` in qis-compiler, the same lowering result/debug use; the bespoke borrow-array path is gone. - Tests + snapshots updated to standard arrays; classification and narrow-int rejection unchanged. The asymmetry that motivated this is a guppy compilation choice: guppy bridges borrow_array -> standard array before `result`, so the matching bridge will be added before `read_arg` in the guppy entrypoint wrapper. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- qis-compiler/rust/lib.rs | 8 +- tket-qsystem/src/extension/argreader.rs | 8 +- tket-qsystem/src/llvm/argreader.rs | 105 +++++++----------- tket-qsystem/src/llvm/array_utils.rs | 24 +++- ...test__emit_argreader_codegen@llvm21_4.snap | 26 ++--- ...test__emit_argreader_codegen@llvm21_5.snap | 26 ++--- ...test__emit_argreader_codegen@llvm21_6.snap | 26 ++--- ...rgreader_codegen@pre-mem2reg@llvm21_4.snap | 38 +++---- ...rgreader_codegen@pre-mem2reg@llvm21_5.snap | 38 +++---- ...rgreader_codegen@pre-mem2reg@llvm21_6.snap | 38 +++---- 10 files changed, 146 insertions(+), 191 deletions(-) diff --git a/qis-compiler/rust/lib.rs b/qis-compiler/rust/lib.rs index b8ce5f397..8aecfeb77 100644 --- a/qis-compiler/rust/lib.rs +++ b/qis-compiler/rust/lib.rs @@ -141,9 +141,9 @@ fn codegen_extensions(platform: qsystem::QSystemPlatform) -> CodegenExtsMap<'sta // State results use standard arrays. .add_extension(DebugCodegenExtension::new(SeleneHeapArrayCodegen::LOWERING)) .add_extension(gpu::GpuCodegen) - // Argument reading + // Argument reading uses standard arrays. .add_extension(ArgReaderCodegenExtension::new( - array::SeleneHeapBorrowArrayCodegen(pcg), + SeleneHeapArrayCodegen::LOWERING, )) .finish() } @@ -222,10 +222,10 @@ fn get_entry_point_name(namer: &Namer, hugr: &impl HugrView) -> Res .as_func_defn() .ok_or_else(|| anyhow!("Entry point node is not a function definition"))?; if func_defn.inner_signature().input_count() != 0 { - return Err(anyhow!( + bail!( "Entry point function must have no input parameters (found {})", func_defn.inner_signature().input_count() - )); + ); } (func_defn.func_name().as_ref(), hugr.entrypoint()) }; diff --git a/tket-qsystem/src/extension/argreader.rs b/tket-qsystem/src/extension/argreader.rs index 46d613bb2..3fcb005de 100644 --- a/tket-qsystem/src/extension/argreader.rs +++ b/tket-qsystem/src/extension/argreader.rs @@ -185,7 +185,7 @@ pub(crate) mod test { use hugr::extension::simple_op::{HasConcrete, MakeRegisteredOp}; use hugr::std_extensions::arithmetic::float_types::float64_type; use hugr::std_extensions::arithmetic::int_types::int_type; - use hugr::std_extensions::collections::borrow_array::borrow_array_type; + use hugr::std_extensions::collections::array::array_type; use hugr::types::TypeArg; use rstest::rstest; @@ -198,9 +198,9 @@ pub(crate) mod test { #[case("my_bool", bool_t())] #[case("my_int", int_type(TypeArg::BoundedNat(6)))] #[case("my_f64", float64_type())] - #[case("my_arr_bool", borrow_array_type(10, bool_t()))] - #[case("my_arr_int", borrow_array_type(10, int_type(TypeArg::BoundedNat(6))))] - #[case("my_arr_f64", borrow_array_type(10, float64_type()))] + #[case("my_arr_bool", array_type(10, bool_t()))] + #[case("my_arr_int", array_type(10, int_type(TypeArg::BoundedNat(6))))] + #[case("my_arr_f64", array_type(10, float64_type()))] fn test_roundtrip(#[case] tag: &str, #[case] output_type: Type) { let op = ReadArgOp::new(tag, output_type); assert_eq!(roundtrip(op.clone()), op); diff --git a/tket-qsystem/src/llvm/argreader.rs b/tket-qsystem/src/llvm/argreader.rs index 09286ebdf..36bbc156a 100644 --- a/tket-qsystem/src/llvm/argreader.rs +++ b/tket-qsystem/src/llvm/argreader.rs @@ -1,20 +1,18 @@ //! LLVM lowering implementations for the "tket.argreader" extension. use crate::extension::argreader::{ReadArgOp, ReadArgOpDef}; +use crate::llvm::array_utils::ArrayLowering; use crate::llvm::prelude::emit_global_string; use anyhow::{Result, anyhow, bail}; use hugr::extension::prelude::bool_t; use hugr::llvm::CodegenExtsBuilder; use hugr::llvm::custom::CodegenExtension; use hugr::llvm::emit::{EmitFuncContext, EmitOpArgs}; -use hugr::llvm::extension::collections::borrow_array::{ - self as llvm_borrow_array, BorrowArrayCodegen, -}; use hugr::llvm::inkwell; use hugr::std_extensions::arithmetic::float_types::float64_type; use hugr::std_extensions::arithmetic::int_types::{INT_TYPES, LOG_WIDTH_MAX}; -use hugr::std_extensions::collections::borrow_array::{ - EXTENSION_ID as BORROW_ARRAY_EXTENSION_ID, borrow_array_type_def, +use hugr::std_extensions::collections::array::{ + EXTENSION_ID as ARRAY_EXTENSION_ID, array_type_def, }; use hugr::types::{Term, Type, TypeArg}; use inkwell::AddressSpace; @@ -115,17 +113,15 @@ fn as_int_log_width(ty: &Type) -> Option { .map(|w| w as u8) } -/// If `ty` is a `borrow_array`, return its `(size, element type)`. +/// If `ty` is a standard `array`, return its `(size, element type)`. /// /// Verifies both the extension id and the type name against the canonical type def, /// and recovers the element type via [`Type::try_from`]. -fn as_borrow_array(ty: &Type) -> Option<(u64, Type)> { +fn as_std_array(ty: &Type) -> Option<(u64, Type)> { let Term::ExtensionType(custom) = &**ty else { return None; }; - if *custom.extension() != BORROW_ARRAY_EXTENSION_ID - || custom.name() != borrow_array_type_def().name() - { + if *custom.extension() != ARRAY_EXTENSION_ID || custom.name() != array_type_def().name() { return None; } match custom.args() { @@ -166,10 +162,10 @@ fn classify_scalar(ty: &Type) -> Option> { fn classify_arg_type(ty: &Type) -> Result { if let Some(scalar) = classify_scalar(ty) { scalar.map(Scalar::scalar_kind) - } else if let Some((size, elem)) = as_borrow_array(ty) { + } else if let Some((size, elem)) = as_std_array(ty) { match classify_scalar(&elem) { Some(scalar) => scalar.map(|s| s.array_kind(size)), - None => bail!("Unsupported borrow_array element type for argument reading: {elem}"), + None => bail!("Unsupported array element type for argument reading: {elem}"), } } else { bail!("Unsupported type for argument reading: {ty}"); @@ -178,20 +174,18 @@ fn classify_arg_type(ty: &Type) -> Result { /// Codegen extension for the argreader #[derive(Default)] -pub struct ArgReaderCodegenExtension { - borrow_array_codegen: BAC, +pub struct ArgReaderCodegenExtension { + array_lowering: AL, } -impl ArgReaderCodegenExtension { +impl ArgReaderCodegenExtension { /// Creates a new [ArgReaderCodegenExtension] with specified array lowering. - pub const fn new(borrow_array_codegen: BAC) -> Self { - Self { - borrow_array_codegen, - } + pub const fn new(array_lowering: AL) -> Self { + Self { array_lowering } } } -impl CodegenExtension for ArgReaderCodegenExtension { +impl CodegenExtension for ArgReaderCodegenExtension { fn add_extension<'a, H: HugrView + 'a>( self, builder: CodegenExtsBuilder<'a, H>, @@ -201,19 +195,17 @@ impl CodegenExtension for ArgReaderCodegenExten { builder.simple_extension_op::(move |context, args, _op| { let op = ReadArgOp::from_extension_op(args.node().as_ref())?; - ArgReaderEmitter(context, self.borrow_array_codegen.clone()).emit(args, &op) + ArgReaderEmitter(context, self.array_lowering.clone()).emit(args, &op) }) } } -struct ArgReaderEmitter<'c, 'd, 'e, H: HugrView, BAC: BorrowArrayCodegen>( +struct ArgReaderEmitter<'c, 'd, 'e, H: HugrView, AL: ArrayLowering>( &'d mut EmitFuncContext<'c, 'e, H>, - BAC, + AL, ); -impl<'c, H: HugrView, BAC: BorrowArrayCodegen + Clone> - ArgReaderEmitter<'c, '_, '_, H, BAC> -{ +impl<'c, H: HugrView, AL: ArrayLowering + Clone> ArgReaderEmitter<'c, '_, '_, H, AL> { fn iw_context(&self) -> &'c Context { self.0.typing_session().iw_context() } @@ -328,18 +320,16 @@ impl<'c, H: HugrView, BAC: BorrowArrayCodegen + Clone> elem_ty: BasicTypeEnum<'c>, call_name: &str, ) -> Result> { - if len > u32::MAX as u64 { - bail!("Array length {} exceeds u32::MAX", len); - } + let len_u32 = + u32::try_from(len).map_err(|_| anyhow!("Array length {len} exceeds u32::MAX"))?; let len_val = self.i64_t().const_int(len, false); - let (elems_ptr, barray_value) = - llvm_borrow_array::build_barray_alloc(self.0, &self.1, elem_ty, len, false)?; + let (elems_ptr, array_value) = self.1.alloc_array(self.0, elem_ty, len_u32)?; self.builder().build_call( argread_fn, &[tag_ptr.into(), elems_ptr.into(), len_val.into()], call_name, )?; - Ok(barray_value.into()) + Ok(array_value) } } @@ -347,58 +337,53 @@ impl<'c, H: HugrView, BAC: BorrowArrayCodegen + Clone> mod test { use super::*; use crate::extension::argreader::ReadArgOp; + use crate::llvm::array_utils::DEFAULT_HEAP_ARRAY_LOWERING; use hugr::extension::prelude::bool_t; use hugr::extension::simple_op::MakeRegisteredOp; use hugr::llvm::check_emission; - use hugr::llvm::extension::collections::borrow_array::{ - BorrowArrayCodegenExtension, DefaultBorrowArrayCodegen, - }; use hugr::llvm::test::{TestContext, llvm_ctx, single_op_hugr}; use hugr::std_extensions::arithmetic::{float_types::float64_type, int_types::int_type}; - use hugr::std_extensions::collections::borrow_array::borrow_array_type; + use hugr::std_extensions::collections::array::array_type; use hugr::types::TypeArg; use rstest::rstest; use crate::llvm::prelude::QISPreludeCodegen; #[rstest] - #[case::bool(1, ReadArgOp::new("test_bool", bool_t()))] - #[case::int(2, ReadArgOp::new("test_int", int_type(TypeArg::BoundedNat(6))))] - #[case::f64(3, ReadArgOp::new("test_f64", float64_type()))] - #[case::arr_bool(4, ReadArgOp::new("test_arr_bool", borrow_array_type(10, bool_t())))] + #[case::bool(1, ReadArgOp::new("test_bool", bool_t()), &DEFAULT_HEAP_ARRAY_LOWERING)] + #[case::int(2, ReadArgOp::new("test_int", int_type(TypeArg::BoundedNat(6))), &DEFAULT_HEAP_ARRAY_LOWERING)] + #[case::f64(3, ReadArgOp::new("test_f64", float64_type()), &DEFAULT_HEAP_ARRAY_LOWERING)] + #[case::arr_bool(4, ReadArgOp::new("test_arr_bool", array_type(10, bool_t())), &DEFAULT_HEAP_ARRAY_LOWERING)] #[case::arr_int( 5, - ReadArgOp::new( - "test_arr_int", - borrow_array_type(10, int_type(TypeArg::BoundedNat(6))) - ) + ReadArgOp::new("test_arr_int", array_type(10, int_type(TypeArg::BoundedNat(6)))), + &DEFAULT_HEAP_ARRAY_LOWERING )] #[case::arr_f64( 6, - ReadArgOp::new("test_arr_f64", borrow_array_type(10, float64_type())) + ReadArgOp::new("test_arr_f64", array_type(10, float64_type())), + &DEFAULT_HEAP_ARRAY_LOWERING )] #[should_panic(expected = "Empty argument name tag received")] - #[case::empty_tag(7, ReadArgOp::new("", bool_t()))] + #[case::empty_tag(7, ReadArgOp::new("", bool_t()), &DEFAULT_HEAP_ARRAY_LOWERING)] #[should_panic(expected = "log-width 6")] - #[case::narrow_int(8, ReadArgOp::new("test_narrow", int_type(TypeArg::BoundedNat(3))))] + #[case::narrow_int(8, ReadArgOp::new("test_narrow", int_type(TypeArg::BoundedNat(3))), &DEFAULT_HEAP_ARRAY_LOWERING)] #[should_panic(expected = "log-width 6")] #[case::narrow_int_arr( 9, - ReadArgOp::new( - "test_narrow_arr", - borrow_array_type(4, int_type(TypeArg::BoundedNat(3))) - ) + ReadArgOp::new("test_narrow_arr", array_type(4, int_type(TypeArg::BoundedNat(3)))), + &DEFAULT_HEAP_ARRAY_LOWERING )] fn emit_argreader_codegen( #[case] _i: i32, #[with(_i)] mut llvm_ctx: TestContext, #[case] op: ReadArgOp, + #[case] array_lowering: &'static (impl ArrayLowering + Clone), ) { let pcg = QISPreludeCodegen; - let bac = DefaultBorrowArrayCodegen::::default(); llvm_ctx.add_extensions(move |ceb| { - ceb.add_extension(ArgReaderCodegenExtension::new(bac.clone())) - .add_extension(BorrowArrayCodegenExtension::from(bac.clone())) + ceb.add_extension(ArgReaderCodegenExtension::new(array_lowering.clone())) + .add_extension(array_lowering.codegen_extension()) .add_prelude_extensions(pcg.clone()) .add_default_int_extensions() .add_float_extensions() @@ -412,12 +397,9 @@ mod test { #[case::bool(bool_t(), ArgKind::Bool)] #[case::int(int_type(TypeArg::BoundedNat(6)), ArgKind::Int)] #[case::f64(float64_type(), ArgKind::F64)] - #[case::arr_bool(borrow_array_type(10, bool_t()), ArgKind::ArrBool(10))] - #[case::arr_int( - borrow_array_type(10, int_type(TypeArg::BoundedNat(6))), - ArgKind::ArrInt(10) - )] - #[case::arr_f64(borrow_array_type(10, float64_type()), ArgKind::ArrF64(10))] + #[case::arr_bool(array_type(10, bool_t()), ArgKind::ArrBool(10))] + #[case::arr_int(array_type(10, int_type(TypeArg::BoundedNat(6))), ArgKind::ArrInt(10))] + #[case::arr_f64(array_type(10, float64_type()), ArgKind::ArrF64(10))] fn test_classify(#[case] ty: Type, #[case] expected: ArgKind) { assert_eq!(classify_arg_type(&ty).unwrap(), expected); } @@ -435,8 +417,7 @@ mod test { #[test] fn test_classify_arr_int_rejects_narrow() { - let err = - classify_arg_type(&borrow_array_type(4, int_type(TypeArg::BoundedNat(3)))).unwrap_err(); + let err = classify_arg_type(&array_type(4, int_type(TypeArg::BoundedNat(3)))).unwrap_err(); assert!(err.to_string().contains("log-width 6"), "{err}"); } } diff --git a/tket-qsystem/src/llvm/array_utils.rs b/tket-qsystem/src/llvm/array_utils.rs index 82ccdd6af..2cbb37f48 100644 --- a/tket-qsystem/src/llvm/array_utils.rs +++ b/tket-qsystem/src/llvm/array_utils.rs @@ -7,7 +7,7 @@ use hugr::extension::prelude::usize_t; use hugr::llvm::emit::EmitFuncContext; use hugr::llvm::extension::collections::array; use hugr::llvm::extension::collections::array::{ - build_array_fat_pointer, decompose_array_fat_pointer, + build_array_alloc, build_array_fat_pointer, decompose_array_fat_pointer, }; use hugr::llvm::inkwell::types::{BasicType, BasicTypeEnum}; use hugr::llvm::inkwell::values::BasicValueEnum; @@ -44,6 +44,18 @@ pub trait ArrayLowering { elem_type: BasicTypeEnum<'c>, length: u32, ) -> Result>; + + /// Allocates a fresh array of `length` elements of type `elem_type` in the given lowering. + /// + /// Returns a pointer to the first element (for writing the contents) together with the + /// array value in the lowering. Unlike [`ArrayLowering::array_from_ptr`], this owns the + /// allocation, so it is used by codegen that *produces* arrays. + fn alloc_array<'c, H: HugrView>( + &self, + ctx: &mut EmitFuncContext<'c, '_, H>, + elem_type: BasicTypeEnum<'c>, + length: u32, + ) -> Result<(PointerValue<'c>, BasicValueEnum<'c>)>; } /// Array lowering via a heap as implemented in [mod@array]. @@ -95,6 +107,16 @@ impl ArrayLowering for HeapArrayLowering let array = build_array_fat_pointer(ctx, ptr, offset)?; Ok(array.into()) } + + fn alloc_array<'c, H: HugrView>( + &self, + ctx: &mut EmitFuncContext<'c, '_, H>, + elem_type: BasicTypeEnum<'c>, + length: u32, + ) -> Result<(PointerValue<'c>, BasicValueEnum<'c>)> { + let (elem_ptr, array_v) = build_array_alloc(ctx, &self.0, elem_type, u64::from(length))?; + Ok((elem_ptr, array_v.into())) + } } /// Helper function to allocate an array on the stack. diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_4.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_4.snap index 795be1741..cc599b1a7 100644 --- a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_4.snap +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_4.snap @@ -7,31 +7,23 @@ source_filename = "test_context" @argument_test_arr_b.A74DBE76.0 = private constant [14 x i8] c"\0Dtest_arr_bool" -define internal { ptr, ptr, i64 } @_hl.main.1() !dbg !3 { +define internal { ptr, i64 } @_hl.main.1() !dbg !3 { alloca_block: br label %entry_block entry_block: ; preds = %alloca_block - %array_size = mul i64 10, ptrtoint (ptr getelementptr (i1, ptr null, i32 1) to i64), !dbg !11 - %0 = call ptr @malloc(i64 %array_size), !dbg !11 - %1 = call ptr @malloc(i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64)), !dbg !11 - call void @llvm.memset.p0.i64(ptr %1, i8 0, i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), i1 false), !dbg !11 - %2 = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0, !dbg !11 - %3 = insertvalue { ptr, ptr, i64 } %2, ptr %1, 1, !dbg !11 - %4 = insertvalue { ptr, ptr, i64 } %3, i64 0, 2, !dbg !11 - call void @argreader_get_bool_array(ptr @argument_test_arr_b.A74DBE76.0, ptr %0, i64 10), !dbg !11 - ret { ptr, ptr, i64 } %4 + %0 = mul i64 10, ptrtoint (ptr getelementptr (i1, ptr null, i32 1) to i64), !dbg !11 + %1 = call ptr @malloc(i64 %0), !dbg !11 + %2 = insertvalue { ptr, i64 } poison, ptr %1, 0, !dbg !11 + %3 = insertvalue { ptr, i64 } %2, i64 0, 1, !dbg !11 + call void @argreader_get_bool_array(ptr @argument_test_arr_b.A74DBE76.0, ptr %1, i64 10), !dbg !11 + ret { ptr, i64 } %3 } declare void @argreader_get_bool_array(ptr, ptr, i64) declare ptr @malloc(i64) -; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 - -attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } - !llvm.module.flags = !{!0} !llvm.dbg.cu = !{!1} @@ -42,8 +34,8 @@ attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } !4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") !5 = !DISubroutineType(types: !6) !6 = !{!7} -!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !8) -!8 = !{!9, !9, !10} +!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, i64 }", file: !2, size: 128, align: 8, elements: !8) +!8 = !{!9, !10} !9 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) !10 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) !11 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_5.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_5.snap index 180b7f543..06e104cda 100644 --- a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_5.snap +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_5.snap @@ -7,31 +7,23 @@ source_filename = "test_context" @argument_test_arr_i.EF2BFDB2.0 = private constant [13 x i8] c"\0Ctest_arr_int" -define internal { ptr, ptr, i64 } @_hl.main.1() !dbg !3 { +define internal { ptr, i64 } @_hl.main.1() !dbg !3 { alloca_block: br label %entry_block entry_block: ; preds = %alloca_block - %array_size = mul i64 10, ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), !dbg !11 - %0 = call ptr @malloc(i64 %array_size), !dbg !11 - %1 = call ptr @malloc(i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64)), !dbg !11 - call void @llvm.memset.p0.i64(ptr %1, i8 0, i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), i1 false), !dbg !11 - %2 = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0, !dbg !11 - %3 = insertvalue { ptr, ptr, i64 } %2, ptr %1, 1, !dbg !11 - %4 = insertvalue { ptr, ptr, i64 } %3, i64 0, 2, !dbg !11 - call void @argreader_get_i64_array(ptr @argument_test_arr_i.EF2BFDB2.0, ptr %0, i64 10), !dbg !11 - ret { ptr, ptr, i64 } %4 + %0 = mul i64 10, ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), !dbg !11 + %1 = call ptr @malloc(i64 %0), !dbg !11 + %2 = insertvalue { ptr, i64 } poison, ptr %1, 0, !dbg !11 + %3 = insertvalue { ptr, i64 } %2, i64 0, 1, !dbg !11 + call void @argreader_get_i64_array(ptr @argument_test_arr_i.EF2BFDB2.0, ptr %1, i64 10), !dbg !11 + ret { ptr, i64 } %3 } declare void @argreader_get_i64_array(ptr, ptr, i64) declare ptr @malloc(i64) -; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 - -attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } - !llvm.module.flags = !{!0} !llvm.dbg.cu = !{!1} @@ -42,8 +34,8 @@ attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } !4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") !5 = !DISubroutineType(types: !6) !6 = !{!7} -!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !8) -!8 = !{!9, !9, !10} +!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, i64 }", file: !2, size: 128, align: 8, elements: !8) +!8 = !{!9, !10} !9 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) !10 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) !11 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_6.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_6.snap index 25994274a..0234d0794 100644 --- a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_6.snap +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@llvm21_6.snap @@ -7,31 +7,23 @@ source_filename = "test_context" @argument_test_arr_f.A22F4976.0 = private constant [13 x i8] c"\0Ctest_arr_f64" -define internal { ptr, ptr, i64 } @_hl.main.1() !dbg !3 { +define internal { ptr, i64 } @_hl.main.1() !dbg !3 { alloca_block: br label %entry_block entry_block: ; preds = %alloca_block - %array_size = mul i64 10, ptrtoint (ptr getelementptr (double, ptr null, i32 1) to i64), !dbg !11 - %0 = call ptr @malloc(i64 %array_size), !dbg !11 - %1 = call ptr @malloc(i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64)), !dbg !11 - call void @llvm.memset.p0.i64(ptr %1, i8 0, i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), i1 false), !dbg !11 - %2 = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0, !dbg !11 - %3 = insertvalue { ptr, ptr, i64 } %2, ptr %1, 1, !dbg !11 - %4 = insertvalue { ptr, ptr, i64 } %3, i64 0, 2, !dbg !11 - call void @argreader_get_f64_array(ptr @argument_test_arr_f.A22F4976.0, ptr %0, i64 10), !dbg !11 - ret { ptr, ptr, i64 } %4 + %0 = mul i64 10, ptrtoint (ptr getelementptr (double, ptr null, i32 1) to i64), !dbg !11 + %1 = call ptr @malloc(i64 %0), !dbg !11 + %2 = insertvalue { ptr, i64 } poison, ptr %1, 0, !dbg !11 + %3 = insertvalue { ptr, i64 } %2, i64 0, 1, !dbg !11 + call void @argreader_get_f64_array(ptr @argument_test_arr_f.A22F4976.0, ptr %1, i64 10), !dbg !11 + ret { ptr, i64 } %3 } declare void @argreader_get_f64_array(ptr, ptr, i64) declare ptr @malloc(i64) -; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 - -attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } - !llvm.module.flags = !{!0} !llvm.dbg.cu = !{!1} @@ -42,8 +34,8 @@ attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } !4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") !5 = !DISubroutineType(types: !6) !6 = !{!7} -!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !8) -!8 = !{!9, !9, !10} +!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, i64 }", file: !2, size: 128, align: 8, elements: !8) +!8 = !{!9, !10} !9 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) !10 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) !11 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_4.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_4.snap index 34af15320..428706aa5 100644 --- a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_4.snap +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_4.snap @@ -7,37 +7,29 @@ source_filename = "test_context" @argument_test_arr_b.A74DBE76.0 = private constant [14 x i8] c"\0Dtest_arr_bool" -define internal { ptr, ptr, i64 } @_hl.main.1() !dbg !3 { +define internal { ptr, i64 } @_hl.main.1() !dbg !3 { alloca_block: - %"0" = alloca { ptr, ptr, i64 }, align 8 - %"4_0" = alloca { ptr, ptr, i64 }, align 8 + %"0" = alloca { ptr, i64 }, align 8 + %"4_0" = alloca { ptr, i64 }, align 8 br label %entry_block entry_block: ; preds = %alloca_block - %array_size = mul i64 10, ptrtoint (ptr getelementptr (i1, ptr null, i32 1) to i64), !dbg !11 - %0 = call ptr @malloc(i64 %array_size), !dbg !11 - %1 = call ptr @malloc(i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64)), !dbg !11 - call void @llvm.memset.p0.i64(ptr %1, i8 0, i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), i1 false), !dbg !11 - %2 = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0, !dbg !11 - %3 = insertvalue { ptr, ptr, i64 } %2, ptr %1, 1, !dbg !11 - %4 = insertvalue { ptr, ptr, i64 } %3, i64 0, 2, !dbg !11 - call void @argreader_get_bool_array(ptr @argument_test_arr_b.A74DBE76.0, ptr %0, i64 10), !dbg !11 - store { ptr, ptr, i64 } %4, ptr %"4_0", align 8, !dbg !11 - %"4_01" = load { ptr, ptr, i64 }, ptr %"4_0", align 8 - store { ptr, ptr, i64 } %"4_01", ptr %"0", align 8 - %"02" = load { ptr, ptr, i64 }, ptr %"0", align 8 - ret { ptr, ptr, i64 } %"02" + %0 = mul i64 10, ptrtoint (ptr getelementptr (i1, ptr null, i32 1) to i64), !dbg !11 + %1 = call ptr @malloc(i64 %0), !dbg !11 + %2 = insertvalue { ptr, i64 } poison, ptr %1, 0, !dbg !11 + %3 = insertvalue { ptr, i64 } %2, i64 0, 1, !dbg !11 + call void @argreader_get_bool_array(ptr @argument_test_arr_b.A74DBE76.0, ptr %1, i64 10), !dbg !11 + store { ptr, i64 } %3, ptr %"4_0", align 8, !dbg !11 + %"4_01" = load { ptr, i64 }, ptr %"4_0", align 8 + store { ptr, i64 } %"4_01", ptr %"0", align 8 + %"02" = load { ptr, i64 }, ptr %"0", align 8 + ret { ptr, i64 } %"02" } declare void @argreader_get_bool_array(ptr, ptr, i64) declare ptr @malloc(i64) -; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 - -attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } - !llvm.module.flags = !{!0} !llvm.dbg.cu = !{!1} @@ -48,8 +40,8 @@ attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } !4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") !5 = !DISubroutineType(types: !6) !6 = !{!7} -!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !8) -!8 = !{!9, !9, !10} +!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, i64 }", file: !2, size: 128, align: 8, elements: !8) +!8 = !{!9, !10} !9 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) !10 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) !11 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_5.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_5.snap index 6bd08c48d..887239527 100644 --- a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_5.snap +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_5.snap @@ -7,37 +7,29 @@ source_filename = "test_context" @argument_test_arr_i.EF2BFDB2.0 = private constant [13 x i8] c"\0Ctest_arr_int" -define internal { ptr, ptr, i64 } @_hl.main.1() !dbg !3 { +define internal { ptr, i64 } @_hl.main.1() !dbg !3 { alloca_block: - %"0" = alloca { ptr, ptr, i64 }, align 8 - %"4_0" = alloca { ptr, ptr, i64 }, align 8 + %"0" = alloca { ptr, i64 }, align 8 + %"4_0" = alloca { ptr, i64 }, align 8 br label %entry_block entry_block: ; preds = %alloca_block - %array_size = mul i64 10, ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), !dbg !11 - %0 = call ptr @malloc(i64 %array_size), !dbg !11 - %1 = call ptr @malloc(i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64)), !dbg !11 - call void @llvm.memset.p0.i64(ptr %1, i8 0, i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), i1 false), !dbg !11 - %2 = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0, !dbg !11 - %3 = insertvalue { ptr, ptr, i64 } %2, ptr %1, 1, !dbg !11 - %4 = insertvalue { ptr, ptr, i64 } %3, i64 0, 2, !dbg !11 - call void @argreader_get_i64_array(ptr @argument_test_arr_i.EF2BFDB2.0, ptr %0, i64 10), !dbg !11 - store { ptr, ptr, i64 } %4, ptr %"4_0", align 8, !dbg !11 - %"4_01" = load { ptr, ptr, i64 }, ptr %"4_0", align 8 - store { ptr, ptr, i64 } %"4_01", ptr %"0", align 8 - %"02" = load { ptr, ptr, i64 }, ptr %"0", align 8 - ret { ptr, ptr, i64 } %"02" + %0 = mul i64 10, ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), !dbg !11 + %1 = call ptr @malloc(i64 %0), !dbg !11 + %2 = insertvalue { ptr, i64 } poison, ptr %1, 0, !dbg !11 + %3 = insertvalue { ptr, i64 } %2, i64 0, 1, !dbg !11 + call void @argreader_get_i64_array(ptr @argument_test_arr_i.EF2BFDB2.0, ptr %1, i64 10), !dbg !11 + store { ptr, i64 } %3, ptr %"4_0", align 8, !dbg !11 + %"4_01" = load { ptr, i64 }, ptr %"4_0", align 8 + store { ptr, i64 } %"4_01", ptr %"0", align 8 + %"02" = load { ptr, i64 }, ptr %"0", align 8 + ret { ptr, i64 } %"02" } declare void @argreader_get_i64_array(ptr, ptr, i64) declare ptr @malloc(i64) -; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 - -attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } - !llvm.module.flags = !{!0} !llvm.dbg.cu = !{!1} @@ -48,8 +40,8 @@ attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } !4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") !5 = !DISubroutineType(types: !6) !6 = !{!7} -!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !8) -!8 = !{!9, !9, !10} +!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, i64 }", file: !2, size: 128, align: 8, elements: !8) +!8 = !{!9, !10} !9 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) !10 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) !11 = !DILocation(line: 27062, column: 402, scope: !3) diff --git a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_6.snap b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_6.snap index 550fdcb0a..06f83e4b3 100644 --- a/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_6.snap +++ b/tket-qsystem/src/llvm/snapshots/tket_qsystem__llvm__argreader__test__emit_argreader_codegen@pre-mem2reg@llvm21_6.snap @@ -7,37 +7,29 @@ source_filename = "test_context" @argument_test_arr_f.A22F4976.0 = private constant [13 x i8] c"\0Ctest_arr_f64" -define internal { ptr, ptr, i64 } @_hl.main.1() !dbg !3 { +define internal { ptr, i64 } @_hl.main.1() !dbg !3 { alloca_block: - %"0" = alloca { ptr, ptr, i64 }, align 8 - %"4_0" = alloca { ptr, ptr, i64 }, align 8 + %"0" = alloca { ptr, i64 }, align 8 + %"4_0" = alloca { ptr, i64 }, align 8 br label %entry_block entry_block: ; preds = %alloca_block - %array_size = mul i64 10, ptrtoint (ptr getelementptr (double, ptr null, i32 1) to i64), !dbg !11 - %0 = call ptr @malloc(i64 %array_size), !dbg !11 - %1 = call ptr @malloc(i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64)), !dbg !11 - call void @llvm.memset.p0.i64(ptr %1, i8 0, i64 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i64), i1 false), !dbg !11 - %2 = insertvalue { ptr, ptr, i64 } poison, ptr %0, 0, !dbg !11 - %3 = insertvalue { ptr, ptr, i64 } %2, ptr %1, 1, !dbg !11 - %4 = insertvalue { ptr, ptr, i64 } %3, i64 0, 2, !dbg !11 - call void @argreader_get_f64_array(ptr @argument_test_arr_f.A22F4976.0, ptr %0, i64 10), !dbg !11 - store { ptr, ptr, i64 } %4, ptr %"4_0", align 8, !dbg !11 - %"4_01" = load { ptr, ptr, i64 }, ptr %"4_0", align 8 - store { ptr, ptr, i64 } %"4_01", ptr %"0", align 8 - %"02" = load { ptr, ptr, i64 }, ptr %"0", align 8 - ret { ptr, ptr, i64 } %"02" + %0 = mul i64 10, ptrtoint (ptr getelementptr (double, ptr null, i32 1) to i64), !dbg !11 + %1 = call ptr @malloc(i64 %0), !dbg !11 + %2 = insertvalue { ptr, i64 } poison, ptr %1, 0, !dbg !11 + %3 = insertvalue { ptr, i64 } %2, i64 0, 1, !dbg !11 + call void @argreader_get_f64_array(ptr @argument_test_arr_f.A22F4976.0, ptr %1, i64 10), !dbg !11 + store { ptr, i64 } %3, ptr %"4_0", align 8, !dbg !11 + %"4_01" = load { ptr, i64 }, ptr %"4_0", align 8 + store { ptr, i64 } %"4_01", ptr %"0", align 8 + %"02" = load { ptr, i64 }, ptr %"0", align 8 + ret { ptr, i64 } %"02" } declare void @argreader_get_f64_array(ptr, ptr, i64) declare ptr @malloc(i64) -; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 - -attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } - !llvm.module.flags = !{!0} !llvm.dbg.cu = !{!1} @@ -48,8 +40,8 @@ attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } !4 = !DIFile(filename: "/cmJrSnVYeXFf/zCkHdtWCCnkJhPKiWSKICgZuRNRvR/mbrfVq.gpy.py", directory: "") !5 = !DISubroutineType(types: !6) !6 = !{!7} -!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, ptr, i64 }", file: !2, size: 192, align: 8, elements: !8) -!8 = !{!9, !9, !10} +!7 = !DICompositeType(tag: DW_TAG_structure_type, name: "{ ptr, i64 }", file: !2, size: 128, align: 8, elements: !8) +!8 = !{!9, !10} !9 = !DIBasicType(name: "ptr", size: 64, encoding: DW_ATE_address) !10 = !DIBasicType(name: "i64", size: 64, encoding: DW_ATE_unsigned) !11 = !DILocation(line: 27062, column: 402, scope: !3)