1 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_35 -disable-cgp -verify-machineinstrs | FileCheck %s
2 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_35 -disable-cgp -verify-machineinstrs | %ptxas-verify %}
4 ; Disable CGP which also folds branches, so that only BranchFolding is under
7 target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
8 target triple = "nvptx64-nvidia-cuda"
10 define void @foo(i32 %x, ptr %output) {
11 ; CHECK-LABEL: .visible .func foo(
14 %1 = icmp eq i32 %x, 1
15 br i1 %1, label %then, label %else
24 store float 2.0, ptr %output
29 define ptx_kernel void @hoge() #0 {
30 ; CHECK-LABEL: .visible .entry hoge(
32 br i1 undef, label %bb1, label %bb4
34 bb1: ; preds = %bb1, %bb
35 %tmp = phi i64 [ %tmp2, %bb1 ], [ undef, %bb ]
36 %tmp2 = add nsw i64 %tmp, 1
37 %tmp3 = icmp sle i64 %tmp, 0
38 br i1 %tmp3, label %bb1, label %bb4
40 bb4: ; preds = %bb4, %bb1, %bb