[PATCH] D139726: llvm-reduce: Fix invalid reductions with llvm.used

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 12:06:55 PST 2022


arsenm closed this revision.
arsenm marked an inline comment as done.
arsenm added a comment.

aa9bdd50c25aa6a6dc58f2af397bdfcfad417244 <https://reviews.llvm.org/rGaa9bdd50c25aa6a6dc58f2af397bdfcfad417244>



================
Comment at: llvm/lib/Transforms/Utils/ModuleUtils.cpp:147
+  }
+}
+
----------------
arsenm wrote:
> jdoerfert wrote:
> > Nits:
> > Early exit in the end.
> > Surprised we need .getArrayRef()
> > Here and elsewhere, we should keep GV around until we insert the new GlobalVariable before it to avoid reorderings in the IR.
> > Remove `llvm::`
> If you create the new one when the old one still exists, you get "@llvm.used0" which is wrong. Avoiding reordering would require finding the neighbor global
I remembered takeName exists, so managed to fix this


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

https://reviews.llvm.org/D139726



More information about the llvm-commits mailing list