[PATCH] D80602: [BranchFolding] Drop location when hoisting

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 16:04:03 PDT 2020


vsk added inline comments.


================
Comment at: llvm/lib/CodeGen/BranchFolding.cpp:2028
+  for (auto &TBBI : *TBB)
+    TBBI.setDebugLoc(DebugLoc());
+
----------------
vsk wrote:
> To summarize some offline discussions:
> - We haven't yet nailed down what should happen to hoisted debug insts, we should discuss (maybe in a follow-up to D80052)
> - D80670 flags the issue here; if we're going to hoist DBG_VALUEs here, they need a location
I've drafted some rules for updating debug locs here: https://reviews.llvm.org/D81198. We haven't reached consensus around those rules, but my $0.02 is that `HoistCommonCodeInSuccs` should: a) clear the debug locs on the instructions it hoists if it found identical instructions in multiple successor blocks, and b) /not/ hoist any DBG_VALUEs. I haven't written up rules for dealing with DBG_VALUEs yet, but I think the guiding principle is going to be 'touch dbg.value/DBG_VALUE as little as possible' to avoid having assignments show up too early.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80602/new/

https://reviews.llvm.org/D80602





More information about the llvm-commits mailing list