# \#ir

**URL:** https://discourse.julialang.org/tag/ir/746.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Help with IR Manipulation](https://discourse.julialang.org/t/help-with-ir-manipulation/135724)

<div class="topic-metadata">

**Author:** [@charlesknipp](https://discourse.julialang.org/u/charlesknipp)\
**Replies:** 0\
**Last updated:** [February 18, 2026, 4:31pm UTC](https://discourse.julialang.org/t/help-with-ir-manipulation/135724 "2026-02-18T16:31:55Z")

</div>

Since this is a relatively complex stack, I will begin with an overarching explanation of my problem, then contextualize it further. Keeping it Vague Suppose I have a misty closure (MistyClosures.jl), where I want to sp…

---

## ["Compiling" HIR produced by \`ZXCalculus.jl\`](https://discourse.julialang.org/t/compiling-hir-produced-by-zxcalculus-jl/119221)

<div class="topic-metadata">

**Author:** [@bremez](https://discourse.julialang.org/u/bremez)\
**Replies:** 5\
**Last updated:** [September 10, 2024, 5:12pm UTC](https://discourse.julialang.org/t/compiling-hir-produced-by-zxcalculus-jl/119221 "2024-09-10T17:12:13Z")

</div>

I would like to explore the affects of ZX calculus on the synthesis of certain quantum circuits. Thankfully, I saw that Yao has a native Julia implementation in ZXCalculus.jl! However, it seems to me its documentation mi…

---

## [Julia IRs, and how to have Julia compile user-generated IR code](https://discourse.julialang.org/t/julia-irs-and-how-to-have-julia-compile-user-generated-ir-code/105073)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 6\
**Last updated:** [October 19, 2023, 12:45pm UTC](https://discourse.julialang.org/t/julia-irs-and-how-to-have-julia-compile-user-generated-ir-code/105073 "2023-10-19T12:45:39Z")

</div>

In a recently registered tiny package, I have a function whose body is basically just an llvmcall that calls the LLVM unreachable instruction: Core.Intrinsics.llvmcall("unreachable", Cvoid, Tuple{}). The goal is to convi…

---

## [IRTools need help: purge unused arguments from argument list of a function](https://discourse.julialang.org/t/irtools-need-help-purge-unused-arguments-from-argument-list-of-a-function/86431)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 1\
**Last updated:** [August 27, 2022, 2:02pm UTC](https://discourse.julialang.org/t/irtools-need-help-purge-unused-arguments-from-argument-list-of-a-function/86431 "2022-08-27T14:02:20Z")

</div>

Hello, I want to implement a method called “purge\_function\_args”, which remove the n’th argument (which is known to be dummy) from the function arg list. I need a kickstarter for the application of IRTools.jl package. C…

---

## [Transform CodeInfo of a function to get a new function by purging unused args from its arg list](https://discourse.julialang.org/t/transform-codeinfo-of-a-function-to-get-a-new-function-by-purging-unused-args-from-its-arg-list/87459)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 1\
**Last updated:** [September 19, 2022, 10:31am UTC](https://discourse.julialang.org/t/transform-codeinfo-of-a-function-to-get-a-new-function-by-purging-unused-args-from-its-arg-list/87459 "2022-09-19T10:31:13Z")

</div>

Hello, I wish to purge an unused argument from the arglist of a function. Following CodeTransformation.jl, I wrote a function to do this task: function assign\_purge\_argument!(@nospecialize(p::Pair{\<:Function,\<:Function…

---

## [IRTools: how can I insert a shortcycling \`@ifsomething\` into IR?](https://discourse.julialang.org/t/irtools-how-can-i-insert-a-shortcycling-ifsomething-into-ir/65593)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 1\
**Last updated:** [August 1, 2021, 10:59am UTC](https://discourse.julialang.org/t/irtools-how-can-i-insert-a-shortcycling-ifsomething-into-ir/65593 "2021-08-01T10:59:01Z")

</div>

Hi there, I am experimenting with IRTools and IR. So far I understood that branches, including return statements, always have to be last in a block. Hence if I want to create a shortcycling statement like realised by …
