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

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 27 14:19:58 PDT 2021


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


================
Comment at: llvm/test/Transforms/DeadStoreElimination/noop-stores.ll:415
   %call = tail call i8* @calloc(i64 10000, i64 4)
   call void @llvm.memset.p0i8.i64(i8* %call, i8 %v, i64 40000, i1 false)
   ret i8* %call
----------------
nikic wrote:
> I'd suggest adding a variant that stores a constant but non-zero value (e.g. `i8 1`).
> 
> It may also be worthwhile to make sure that passing `i1 true` for the volatile flag will prevent DSE (this should be covered by the isRemovable check in the caller).
Sure, I will add such tests.


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

https://reviews.llvm.org/D101391



More information about the llvm-commits mailing list