[PATCH] D34874: [ArgPromotion] Remove llvm.dbg.value on removed argument

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 30 08:27:30 PDT 2017


rnk added inline comments.


================
Comment at: lib/Transforms/IPO/ArgumentPromotion.cpp:135
+
+      BasicBlock &BB = F->getEntryBlock();
+      SmallVector<Instruction*, 8> InstrsToRemove;
----------------
There's no reason to believe the only uses of the argument will appear in the entry block. I think you really want to do `I->replaceAllUsesWith(undef)` to replace all metadata uses of the argument. Some other pass (instcombine?) can clean up the useless dbg.value instructions. That's what the dead argument elimination pass does, anyway.


https://reviews.llvm.org/D34874





More information about the llvm-commits mailing list