1 ; RUN: opt -S -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
2 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-unknown-linux-gnu"
5 @GV = external constant ptr
7 define ptr @test1(i1 %cond, ptr %P) {
9 br i1 %cond, label %if, label %then
15 %load = load ptr, ptr @GV, align 8, !dereferenceable !0
19 %phi = phi ptr [ %P, %then ], [ %load, %if ]
23 ; CHECK-LABEL: define ptr @test1(
24 ; CHECK: %[[load:.*]] = load ptr, ptr @GV, align 8{{$}}
25 ; CHECK: %[[phi:.*]] = select i1 %cond, ptr %[[load]], ptr %P
26 ; CHECK: ret ptr %[[phi]]