brintos

brintos / llvm-project-archived public Read only

0
0
Text · 583 B · af52925 Raw
25 lines · plain
1; RUN: opt -S -O1 < %s | FileCheck %s2 3@a = common global i32 0, align 44 5; @hook_me is weak, so GMR must not eliminate the reload of @a in @f,6; even though @hook_me doesn't mod or ref @a.7 8; Function Attrs: nounwind ssp uwtable9define weak i32 @hook_me() {10  ret i32 011}12 13; Function Attrs: nounwind ssp uwtable14define i32 @f() {15  %1 = alloca i32, align 416  store i32 4, ptr @a, align 417  %2 = call i32 @hook_me()18  ; CHECK: load i32, ptr @a, align 419  %3 = load i32, ptr @a, align 420  %4 = add nsw i32 %3, %221  store i32 %4, ptr @a, align 422  %5 = load i32, ptr %123  ret i32 %524}25