[llvm] [DirectX] Lower DbgAssign to DbgValue (PR #200267)

Harald van Dijk via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 05:34:18 PDT 2026


hvdijk wrote:

> I wonder if an alternate algorithm where we go through and collect all of the debug values, filter out redundancies, and then do the transformation could be more efficient here.

I don't think it would be: the result for each variable (or variable fragment) needs to be determined independently. If we first build a list of all debug values, then go over that: if we don't have the same `DenseMap`s or equivalent, we have quadratric worst case behaviour (total number of variables times total number of debug values for all variables). If we do have the same `DenseMap`s or equivalent, I don't think collecting all the debug values first saved us anything. But please correct me if I'm overlooking something here.

The suggestion to move the variables out of the loop looks like a good idea though, I'll do that.

https://github.com/llvm/llvm-project/pull/200267


More information about the llvm-commits mailing list