1 ; RUN: opt -instcombine -S < %s | FileCheck %s
6 ; Check that dereferenceable_or_null metadata is combined
8 ; CHECK: load i32*, i32**
9 ; CHECK-SAME: !dereferenceable_or_null ![[DEREF:[0-9]+]]
10 define i32* @test_phi_combine_load_metadata(i1 %c, i32** dereferenceable(8) %p1, i32** dereferenceable(8) %p2) {
11 br i1 %c, label %t, label %f
14 %v1 = load i32*, i32** %p1, align 8, !dereferenceable_or_null !0
19 %v2 = load i32*, i32** %p2, align 8, !dereferenceable_or_null !1
23 %res = phi i32* [ %v1, %t ], [ %v2, %f ]
27 ; CHECK: ![[DEREF]] = !{i64 8}