[PATCH] D76454: [ValueTracking] Fix usage of DataLayout::getTypeStoreSize()

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 20 10:50:21 PDT 2020


sdesmalen added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:3500
 
-  const uint64_t Size = DL.getTypeStoreSize(V->getType());
+  const uint64_t Size = DL.getTypeStoreSize(V->getType()).getKnownMinSize();
   if (!Size)
----------------
efriedma wrote:
> I'm a little uncomfortable with the way getKnownMinSize() is being used here; it's correct, but I don't really like leaving around a variable deceptively named "Size" in a big function like this.
> 
> Maybe it would make sense to add a method isNonZero() to TypeSize?
That's a good suggestion, there are more instances where such a method would be useful.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76454





More information about the llvm-commits mailing list