[cfe-commits] r162701 - in /cfe/trunk: lib/CodeGen/CGDecl.cpp test/CodeGen/init.c

Chandler Carruth chandlerc at google.com
Mon Aug 27 14:40:56 PDT 2012


On Mon, Aug 27, 2012 at 2:35 PM, Benjamin Kramer
<benny.kra at googlemail.com>wrote:

> Author: d0k
> Date: Mon Aug 27 16:35:58 2012
> New Revision: 162701
>
> URL: http://llvm.org/viewvc/llvm-project?rev=162701&view=rev
> Log:
> CodeGen: When emitting stores for an initializer, only emit a GEP if we
> really need the store.
>
> This avoids emitting many dead GEPs for large zero-initialized arrays.
>

A point of clarity for those playing along but not on IRC:


> Modified: cfe/trunk/test/CodeGen/init.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/init.c?rev=162701&r1=162700&r2=162701&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/CodeGen/init.c (original)
> +++ cfe/trunk/test/CodeGen/init.c Mon Aug 27 16:35:58 2012
> @@ -69,6 +69,8 @@
>  // CHECK: store i8 97
>  // CHECK: store i8 98
>  // CHECK: store i8 99
> +// CHECK-NOT: getelementptr
> +// CHECK: load
>

Previously this test case produced 100k dead GEPs here. Yes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120827/2f029a4b/attachment.html>


More information about the cfe-commits mailing list