I am working on `-frepack-array` feature (#127147), which produces non-trivial manipulations with arguments of `fir.declare`. In this case, we end up with CFG computation of the `fir.declare` argument, and AddDebugInfo pass incorrectly mapped two dummy arguments to the same arg index in the debug attributes. This patch makes sure that we assign the arg index only if we can prove that we've traced the block argument to the function's entry block. I believe this problem is not specific to `-frepack-arrays`, e.g. it may appear due to MLIR inlining as well.
26 KiB
26 KiB