• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -simplifycfg -S | FileCheck %s
2
3declare void @bar(i32*)
4declare void @baz(i32*)
5
6; CHECK-LABEL: @test_load_combine_metadata(
7; Check that dereferenceable_or_null metadata is combined
8; CHECK: load i32*, i32** %p
9; CHECK-SAME: !dereferenceable_or_null ![[DEREF:[0-9]+]]
10; CHECK: t:
11; CHECK: f:
12define void @test_load_combine_metadata(i1 %c, i32** %p) {
13  br i1 %c, label %t, label %f
14
15t:
16  %v1 = load i32*, i32** %p, !dereferenceable_or_null !0
17  call void @bar(i32* %v1)
18  br label %cont
19
20f:
21  %v2 = load i32*, i32** %p, !dereferenceable_or_null !1
22  call void @baz(i32* %v2)
23  br label %cont
24
25cont:
26  ret void
27}
28
29; CHECK: ![[DEREF]] = !{i64 8}
30
31!0 = !{i64 8}
32!1 = !{i64 16}
33