brintos

brintos / llvm-project-archived public Read only

0
0
Text · 721 B · 75a8361 Raw
25 lines · plain
1; RUN: opt -passes=globalopt -S < %s | FileCheck %s2; CHECK: @Y = {{.*}} section ".foo"3 4%struct.xyz = type { double, i32 }5 6@Y = internal global ptr null ,section ".foo"            ; <ptr> [#uses=2]7@numf2s = external global i32                     ; <ptr> [#uses=1]8 9define void @init_net()  {10entry:11  %0 = load i32, ptr @numf2s, align 4                 ; <i32> [#uses=1]12  %mallocsize2 = shl i32 %0, 4                    ; <i32> [#uses=1]13  %malloccall3 = tail call ptr @malloc(i32 %mallocsize2)  ; <ptr> [#uses=1]14  store ptr %malloccall3, ptr @Y, align 815  ret void16}17 18define void @load_train()  {19entry:20  %0 = load ptr, ptr @Y, align 8             ; <ptr> [#uses=0]21  ret void22}23 24declare noalias ptr @malloc(i32)25