[PATCH] D89810: [mem2reg] Remove dbg.values describing contents of dead allocas

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 01:42:46 PDT 2020


Orlando added a comment.

Hi @vsk, thanks for taking a look, I'll address your inline comments shortly.

On the topic of stale values after inlining+DSE: Could we teach the inliner to insert dbg.values in the same pattern as LowerDbgDeclare for parameters which are pointers to callee-local allocas? E.g. in the following example, we would have the inliner would insert a `dbg.value(%storevalue0xff, "param", DIExpression())` after the inlined store `*p = 0xff`. After the store is deleted we'd end up with a salvagedOrUndef dbg.value at the store site. wdyt?

  int g;
  __attribute__((__always_inline__))
  static void use(int* p) {
    g = *p;
    *p = 0xff;  // After inlining, insert a dbg.value before this store, just like LowerDbgDeclare.
  }
  void fun(int param) {
    use(&param);
  }


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

https://reviews.llvm.org/D89810



More information about the llvm-commits mailing list