brintos

brintos / llvm-project-archived public Read only

0
0
Text · 767 B · be2575b Raw
17 lines · plain
1; RUN: opt < %s -passes=globalopt -S | FileCheck %s2 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 167; We cannot SRA here due to the second gep meaning the access to g_data may be to either element8; 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] }>, ptr @g_data, i64 0, i32 013  %arrayidx.i = getelementptr inbounds [8 x i16], ptr %g1, i64 0, i64 %a114  %r = load i16, ptr %arrayidx.i, align 215  ret i16 %r16}17