[PATCH] D144476: [GlobalOpt] Extend logic in SRA heuristic to skip stores of initializer.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 02:56:47 PST 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/GlobalOpt.cpp:400
+
+        auto *GlobalVar = dyn_cast<GlobalVariable>(GV);
+        Constant *StoredConst = dyn_cast<Constant>(SI->getOperand(0));
----------------
Rebase over https://github.com/llvm/llvm-project/commit/0ecef88cb167dbd19023a932e7abac09059c3e4e?


================
Comment at: llvm/lib/Transforms/IPO/GlobalOpt.cpp:408
+               !(StoredConst->isNullValue() &&
+                 GlobalVar->getInitializer()->isNullValue());
+      };
----------------
Shouldn't we be comparing with the initializer at the specific offset?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144476



More information about the llvm-commits mailing list