This is a fix for https://bugs.llvm.org/show_bug.cgi?id=49959
The "Missing line" false alarm was introduced in https://reviews.llvm.org/D75242
Differential D100446
[Transforms][Debugify] Fix "Missing line" false alarm on PHI nodes Nuullll on Apr 13 2021, 10:41 PM. Authored by
Details This is a fix for https://bugs.llvm.org/show_bug.cgi?id=49959 The "Missing line" false alarm was introduced in https://reviews.llvm.org/D75242
Diff Detail
Event TimelineComment Actions Context: In D59417 (see also llvm.org/PR37964), there was some debate about whether it's worthwhile to assign a line 0 location to a phi instruction which would otherwise not have a location. The consensus seemed to be: no, it's not worth it. So D75242 was spun off to suppress the false positive in debugify. It looks like D75242 had the unexpected/unfortunate side-effect of introducing a new FP: any unique, preserved DebugLoc attached to a phi instruction because "missing". My two cents is that a total ban on attaching debug location/intrinsic info to phi instructions isn't the best way to fix this. That would lead to a loss in test coverage (we do see cases where passes copy debug locations from phi instructions, or where debug intrinsics refer to phi instructions). I think the current version of this patch (skip the warning on phi instructions) does the right thing. That said I'm no longer very active in debug info reviews so I'll defer to other reviewers. Comment Actions Thanks for your detailed explanation, In my eyes, D75242 eliminated uncommon "warnings" (only pass generate PHI node), but generate common "warnings" (all pass with PHI node ). Comment Actions So this patch will remove reporting warnings of missing debug loc to PHIs completely, right?
Comment Actions Yes
Of course we can. But this warning just for pass generate PHI, we usually ignore warnings if they are make sense. I think the reason @Nuullll write this patch is just that "PHI existed in too many passes, but very few pass generate PHI" Comment Actions Ah, this is my first time trying to make a llvm contribution. Comment Actions Thanks for this! |
Or we don't set debugloc for PHI.