1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=gvn < %s | FileCheck %s
4 define i64 @test(ptr noalias %p, ptr noalias %q) {
7 ; CHECK-NEXT: store ptr [[Q:%.*]], ptr [[P:%.*]], align 8
8 ; CHECK-NEXT: br i1 false, label [[IF:%.*]], label [[MERGE:%.*]]
10 ; CHECK-NEXT: call void @clobber(ptr [[P]])
11 ; CHECK-NEXT: br label [[MERGE]]
13 ; CHECK-NEXT: store i64 1, ptr [[Q]], align 4
14 ; CHECK-NEXT: [[Q3:%.*]] = getelementptr i64, ptr [[Q]], i64 1
15 ; CHECK-NEXT: store i64 2, ptr [[Q3]], align 4
16 ; CHECK-NEXT: ret i64 1
20 br i1 false, label %if, label %merge
23 call void @clobber(ptr %p)
27 %q2 = load ptr, ptr %p
30 %q3 = getelementptr i64, ptr %q, i64 %v
32 %v2 = load i64, ptr %q
36 declare void @clobber(ptr %p)