[PATCH] D101391: [DSE] Eliminate zero memset after calloc

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 27 13:16:49 PDT 2021


nikic added a comment.

I think it would be good to add a negative test where there is a store to the calloc in the meantime.



================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1783
+      if (DefUOInst && isCallocLikeFn(DefUOInst, &TLI)) {
+
+        auto *UnderlyingDef = cast<MemoryDef>(MSSA.getMemoryAccess(DefUOInst));
----------------
nit: unnecessary newline.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101391



More information about the llvm-commits mailing list