43 lines · plain
1; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_35 -disable-cgp -verify-machineinstrs | FileCheck %s2; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64 -mcpu=sm_35 -disable-cgp -verify-machineinstrs | %ptxas-verify %}3 4; Disable CGP which also folds branches, so that only BranchFolding is under5; the spotlight.6 7target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"8target triple = "nvptx64-nvidia-cuda"9 10define void @foo(i32 %x, ptr %output) {11; CHECK-LABEL: .visible .func foo(12; CHECK-NOT: bra.uni13; CHECK-NOT: LBB0_14 %1 = icmp eq i32 %x, 115 br i1 %1, label %then, label %else16 17then:18 br label %merge19 20else:21 br label %merge22 23merge:24 store float 2.0, ptr %output25 ret void26}27 28; PR24299. no crash29define ptx_kernel void @hoge() #0 {30; CHECK-LABEL: .visible .entry hoge(31bb:32 br i1 undef, label %bb1, label %bb433 34bb1: ; preds = %bb1, %bb35 %tmp = phi i64 [ %tmp2, %bb1 ], [ undef, %bb ]36 %tmp2 = add nsw i64 %tmp, 137 %tmp3 = icmp sle i64 %tmp, 038 br i1 %tmp3, label %bb1, label %bb439 40bb4: ; preds = %bb4, %bb1, %bb41 br label %bb442}43