This is another instance of the 'nulling out the debug location of moved instructions' theme. The GVN pass, when performing PRE on load instructions retains the instructions' original debug loc, which causes erratic stepping behavior and incorrect source attribution for autoFDO purposes.
Keeping in mind the ongoing debate about Debug locations for optimized code this patch proposes to null out (or not propagate) the debug locations of such instructions for now to improve debugging behavior.
The modified test case phi-translate.ll covers all cases.
... could lead to confusing (but correct) source attributions.