I have a Triton kernel, which triggered a heap-use-after-free error in LLVM. The problem was that the same instruction may be added to the `ToSimplify` array multiple times. If this duplicate instruction is trivially dead, it gets deleted on the first pass. Then, on the second pass, the freed instruction is passed. To fix this, I'm adding the instructions to the `ToRemove` array and filter it out for duplicates to avoid possible double frees.
8.7 KiB
8.7 KiB