[PATCH] D90302: [llvm-reduce] Add reduction for special globals like llvm.used.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 9 11:35:54 PST 2020


fhahn marked an inline comment as done.
fhahn added inline comments.


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceSpecialGlobals.cpp:24
+
+static auto SpecialGlobalNames = {"llvm.used", "llvm.compiler.used"};
+
----------------
lebedev.ri wrote:
> static StringRef
Update to use `const char *`.


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceSpecialGlobals.cpp:35
+    if (auto *Used = Program->getNamedGlobal(Name)) {
+      Used->replaceAllUsesWith(UndefValue::get(Used->getType()));
+      Used->eraseFromParent();
----------------
lebedev.ri wrote:
> Do we want to be more fine-grained than that?
> Should this be per-use?
Hm, I guess it might be helpful, but I haven't encountered any cases where it would be needed/beneficial in practice. I would prefer to only cross that bridge once it becomes an issue, but I can also update this patch. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90302



More information about the llvm-commits mailing list