[PATCH] D85127: [ArgPromotion] Replace all md uses of promoted values with undef.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 3 10:19:38 PDT 2020


aprantl accepted this revision.
aprantl added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:413
 
-    if (I->use_empty())
+    if (I->use_empty()) {
+      // There potentially are metadata uses left for things like
----------------
We could use 
```
llvm::scope_exit RauwUndef([&]() {
// There potentially are metadata uses left for things like
// llvm.dbg.value. Replace them with undef.
I->replaceAllUsesWith(UndefValue::get(I->getType()));
});

if (I->use_empty())
  continue;
```

I'll leave it up to you to decide whether that's actually better.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85127



More information about the llvm-commits mailing list