[PATCH] D64052: Return Undef from isBytewiseValue for empty arrays or structs
    Eli Friedman via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Jul  2 13:54:46 PDT 2019
    
    
  
efriedma added inline comments.
================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:3187
+    if (!T->getNumElements())
+      return UndefInt8;
+
----------------
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.
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