30 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes=globalopt < %s | FileCheck %s3 4; The global is stored once through a trivial GEP instruction (rather than5; GEP constant expression) here. We should still be able to optimize it.6 7%s = type { i32 }8 9@g = internal unnamed_addr global i32 undef10 11; CHECK-NOT: @g =12 13define void @store() {14; CHECK-LABEL: @store(15; CHECK-NEXT: ret void16;17 store i32 1, ptr @g, align 418 ret void19}20 21define i32 @load() {22; CHECK-LABEL: @load(23; CHECK-NEXT: call fastcc void @store()24; CHECK-NEXT: ret i32 125;26 call fastcc void @store()27 %v = load i32, ptr @g28 ret i32 %v29}30