[llvm] [indvars] Missing variables at Og: (PR #69920)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 18 03:38:12 PST 2024
https://github.com/nikic commented:
This patch still looks pretty odd to me.
The part where we add the debug value if the exit value is rewritten (part of RewritePhiSet) makes sense to me.
The rest does not, for a couple of reasons:
* The use of getInductionVariable() is always a good indicator that you are doing something dubious: It will only recognize some "canonical" induction variable, but a loop may have many IVs. So it looks like you will be preserving the exit value of a single IV only?
* You are adding debug values in a case where *the transform in question does not actually fire*. This indicates to me that you are doing this in the wrong place. I believe that for the case where the IV is effectively dead, the place where it actually gets dropped is in DeleteDeadPHIs, so I would expect that debuginfo preservation would also happen in that area.
* If I'm reading this correctly, for the same reason as the previous point, you will be adding these debug values even if the IV does *not* actually get dropped (because it has real uses in the loop) -- I don't think that's supposed to happen?
Disclaimer: I know nothing about debuginfo, maybe I'm misunderstanding things.
https://github.com/llvm/llvm-project/pull/69920
More information about the llvm-commits
mailing list