1; RUN: opt < %s -globalopt -S | FileCheck %s 2 3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 4target triple = "x86_64-unknown-linux-gnu" 5 6@g_data = internal unnamed_addr global <{ [8 x i16], [8 x i16] }> <{ [8 x i16] [i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16], [8 x i16] zeroinitializer }>, align 16 7; We cannot SRA here due to the second gep meaning the access to g_data may be to either element 8; CHECK: @g_data = internal unnamed_addr constant <{ [8 x i16], [8 x i16] }> 9 10define i16 @test(i64 %a1) { 11entry: 12 %g1 = getelementptr inbounds <{ [8 x i16], [8 x i16] }>, <{ [8 x i16], [8 x i16] }>* @g_data, i64 0, i32 0 13 %arrayidx.i = getelementptr inbounds [8 x i16], [8 x i16]* %g1, i64 0, i64 %a1 14 %r = load i16, i16* %arrayidx.i, align 2 15 ret i16 %r 16} 17