diff options
author | Nikita Popov <npopov@redhat.com> | 2024-06-10 09:19:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-10 09:19:55 +0200 |
commit | 12d24e0c56a154c88247e55c7c352030e4d9073d (patch) | |
tree | 3594166dc0fad81c86f7ac8d41b2346f225d88f1 /clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp | |
parent | a6929dbea8b4525ee41c1269e8e4a2b7182d9ce2 (diff) | |
download | llvm-12d24e0c56a154c88247e55c7c352030e4d9073d.zip llvm-12d24e0c56a154c88247e55c7c352030e4d9073d.tar.gz llvm-12d24e0c56a154c88247e55c7c352030e4d9073d.tar.bz2 |
[CodeGen] Simplify codegen for array initialization (#93956)
This makes codegen for array initialization simpler in two ways:
1. Drop the zero-index GEP at the start, which is no longer needed with
opaque pointers.
2. Emit GEPs directly to the correct element, instead of having a long
chain of +1 GEPs. This is more canonical, and also avoids regressions in
unoptimized builds from #93823.
Diffstat (limited to 'clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp b/clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp index aa2f078..3d0cf96 100644 --- a/clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp +++ b/clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp @@ -122,8 +122,7 @@ void fn1(int i) { // X86: [[array:%[^ ]+]] = alloca [3 x i32] // AMDGCN: [[alloca:%[^ ]+]] = alloca [3 x i32], align 4, addrspace(5) // AMDGCN: [[array:%[^ ]+]] ={{.*}} addrspacecast ptr addrspace(5) [[alloca]] to ptr - // CHECK: getelementptr inbounds [3 x i32], ptr [[array]], i{{32|64}} 0 - // CHECK-NEXT: store i32 1, ptr + // CHECK: store i32 1, ptr // CHECK-NEXT: getelementptr // CHECK-NEXT: store // CHECK-NEXT: getelementptr |