[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 16:17:46 PST 2018


rjmccall added a comment.

Oh.  It's not a good idea to try to match exact local IR names like this for two reasons:

- First, many IR names are different in builds with and without assertions.
- Second, it's pretty susceptible to innocuous changes in output.

You should use FileCheck patterns (`[[TEMP:%.*]] = bitcast [10 x i32]* ...` to define the variable, `[[TEMP]]` to refer to it) instead.

Also, you really have 15 different tests here.  Please split them up into different functions (in the same test file) with at least vaguely meaningful names (like `testStaticNonZero` or `testVolatileAllZeros`).  And please match their definition lines with CHECK-LABEL instead of a simple CHECK; this allows FileCheck to do a better job reporting multiple failures in a single file.

Finally, I'm not sure why you've included the b, c, and d tests at all, since they have nothing to do with your patch.  c4 and d4 don't even involve initialization code.


https://reviews.llvm.org/D42549





More information about the cfe-commits mailing list