[PATCH] D114889: [GlobalOpt] Simplify CleanupConstantGlobalUsers()

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 1 10:57:27 PST 2021


aeubanks added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/GlobalOpt.cpp:307
+      // A load from zeroinitializer is always zeroinitializer, regardless of
+      // any applied offset.
+      if (Init->isNullValue()) {
----------------
is this true for non-inbounds GEPs?


================
Comment at: llvm/lib/Transforms/IPO/GlobalOpt.cpp:334
+
+  RecursivelyDeleteTriviallyDeadInstructionsPermissive(MaybeDeadInsts);
+  GV->removeDeadConstantUsers();
----------------
even though `Changed` should be true if this returns true, still seems good to `Changed |= ...` here to prevent potential future issues


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

https://reviews.llvm.org/D114889



More information about the llvm-commits mailing list