1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes='require<profile-summary>,function(codegenprepare)' -cgp-optimize-phi-types=true %s -S | FileCheck %s
4 target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
5 target triple = "i386-unknown-linux-gnu"
7 define float @convphi1(ptr%s, ptr%d, i32 %n) {
8 ; CHECK-LABEL: @convphi1(
10 ; CHECK-NEXT: [[CMP15:%.*]] = icmp sgt i32 [[N:%.*]], 0
11 ; CHECK-NEXT: br i1 [[CMP15]], label [[THEN:%.*]], label [[ELSE:%.*]]
13 ; CHECK-NEXT: [[LS:%.*]] = load i32, ptr [[S:%.*]], align 4
14 ; CHECK-NEXT: br label [[END:%.*]]
16 ; CHECK-NEXT: [[LD:%.*]] = load i32, ptr [[D:%.*]], align 4
17 ; CHECK-NEXT: br label [[END]]
19 ; CHECK-NEXT: [[PHI:%.*]] = phi i32 [ [[LS]], [[THEN]] ], [ [[LD]], [[ELSE]] ]
20 ; CHECK-NEXT: [[B:%.*]] = bitcast i32 [[PHI]] to float
21 ; CHECK-NEXT: ret float [[B]]
24 %cmp15 = icmp sgt i32 %n, 0
25 br i1 %cmp15, label %then, label %else
28 %ls = load i32, ptr %s, align 4
32 %ld = load i32, ptr %d, align 4
36 %phi = phi i32 [ %ls, %then ], [ %ld, %else ]
37 %b = bitcast i32 %phi to float