brintos

brintos / llvm-project-archived public Read only

0
0
Text · 847 B · 81d44ce Raw
25 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 62; RUN: opt < %s -passes=gvn -S | FileCheck %s3 4%t = type { i32 }5declare void @test1f(ptr)6 7; `%stuff` is noalias, `test1f` receives only null, cannot clobber `%stuff`,8; thus the second load is dead.9define void @test1(ptr noalias %stuff) {10; CHECK-LABEL: define void @test1(11; CHECK-SAME: ptr noalias [[STUFF:%.*]]) {12; CHECK-NEXT:    [[BEFORE:%.*]] = load i32, ptr [[STUFF]], align 413; CHECK-NEXT:    call void @test1f(ptr null)14; CHECK-NEXT:    [[SUM:%.*]] = add i32 [[BEFORE]], [[BEFORE]]15; CHECK-NEXT:    store i32 [[SUM]], ptr [[STUFF]], align 416; CHECK-NEXT:    ret void17;18  %before = load i32, ptr %stuff19  call void @test1f(ptr null)20  %after = load i32, ptr %stuff21  %sum = add i32 %before, %after22  store i32 %sum, ptr %stuff23  ret void24}25