[PATCH] D87233: [POC][DebugInfo] Use entry values within IR

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 05:57:16 PDT 2020


djtodoro added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:1596
 
+Value *llvm::findEntryValue(DIVariable *Var) {
+  // TODO: Find an entry value for local variables,
----------------
Orlando wrote:
> Hi @djtodoro. IIUC this function assumes that the returned `dbg.value` - the first one we find - for parameter variable `Var` uses the corresponding argument value (as opposed to some other value that a mutable parameter could be assigned). If that is correct, why is that assumption safe?
//(Hmm.... I've forgotten to take another look into this, in spite of the fact that I've had an item for it within my TODO list...)//

Hi @Orlando.
I had a crazy premise in my mind, that every parameter should have a dbg_value on the beginning of the bb.entry. In some situations, the Value could be `undef` (due to some optimizations), but it will indicate just that the value has been optimized out (but it should be still there in the code). Is that correct? I've prepared this POC in rush, and have forgotten to check this once again. If the `users()` aren't sorted out, this should be reimplemented.


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

https://reviews.llvm.org/D87233



More information about the llvm-commits mailing list