I skimmed this thread, and my takeaway was that most of these issues would be resolved if we did some serious performance engineering of IR source locations. We already spend the memory to carry a DebugLoc field on every Instruction. We could optimize that to store something like a clang::SourceLocation with 64 bits inline. You can imagine further augmenting that scheme to support inlined source location tracking similar to how we do macro source locations and macro expansion stacks.
3 Likes