1 ; RUN: opt -S -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 i64*
7 define i64* @test1(i1 %cond, i8* %P) {
9 br i1 %cond, label %if, label %then
12 %bc = bitcast i8* %P to i64*
16 %load = load i64*, i64** @GV, align 8, !dereferenceable !0
20 %phi = phi i64* [ %bc, %then ], [ %load, %if ]
24 ; CHECK-LABEL: define i64* @test1(
25 ; CHECK: %[[bc:.*]] = bitcast i8* %P to i64*
26 ; CHECK: %[[load:.*]] = load i64*, i64** @GV, align 8{{$}}
27 ; CHECK: %[[phi:.*]] = select i1 %cond, i64* %[[load]], i64* %[[bc]]
28 ; CHECK: ret i64* %[[phi]]