[PATCH] D42549: [CodeGen] Use the zero initializer instead of storing an all zero representation.

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 8 11:18:11 PST 2018


rjmccall added a comment.

I'm somewhat surprised LLVM doesn't already canonicalize this, but ok.

Should we also do this when building a constant struct?



================
Comment at: lib/CodeGen/CGExprConstant.cpp:873
       Elts.push_back(C);
+      if (!C->isNullValue())
+        AllNullValues = false;
----------------
Please short-circuit this if AllNullValues is already false.


https://reviews.llvm.org/D42549





More information about the cfe-commits mailing list