[PATCH] D64052: Return Undef from isBytewiseValue for empty arrays or structs

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 17:22:18 PDT 2019


vitalybuka marked 2 inline comments as done.
vitalybuka added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:3187
+    if (!T->getNumElements())
+      return UndefInt8;
+
----------------
efriedma wrote:
> Does this work recursively?  For example, `[5 x [0 x i32]]`.  It might be easier to just check the size of the type.
> 
> Actually, we should probably constant-fold `[0 x i8] zeroinitializer` etc., to `[0 x i8] undef`, since there isn't any actual data anyway.  That would make this check unnecessary.
Yep, recursive did not work and size looks simpler.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64052





More information about the llvm-commits mailing list