220 lines · plain
1; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_35 | FileCheck %s2; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64 -mcpu=sm_35 | %ptxas-verify %}3 4target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"5target triple = "nvptx64-unknown-unknown"6 7define ptx_kernel void @PR24303(ptr %f) {8; CHECK-LABEL: .visible .entry PR24303(9; Do not use mov.f or mov.u to convert between float and int.10; CHECK-NOT: mov.{{f|u}}{{32|64}} %f{{[0-9]+}}, %r{{[0-9]+}}11; CHECK-NOT: mov.{{f|u}}{{32|64}} %r{{[0-9]+}}, %f{{[0-9]+}}12entry:13 %arrayidx1 = getelementptr inbounds float, ptr %f, i64 114 %0 = load float, ptr %f, align 415 %1 = load float, ptr %arrayidx1, align 416 %arrayidx2 = getelementptr inbounds float, ptr %f, i64 217 %arrayidx3 = getelementptr inbounds float, ptr %f, i64 318 %2 = load float, ptr %arrayidx2, align 419 %3 = load float, ptr %arrayidx3, align 420 %mul.i = fmul float %0, %221 %mul4.i = fmul float %1, %322 %mul5.i = fmul float %0, %323 %mul6.i = fmul float %1, %224 %sub.i = fsub float %mul.i, %mul4.i25 %4 = bitcast float %sub.i to i3226 %add.i = fadd float %mul6.i, %mul5.i27 %5 = bitcast float %add.i to i3228 %6 = tail call float @llvm.nvvm.fabs.f(float %sub.i) #229 %7 = fcmp ugt float %6, 0x7FF000000000000030 br i1 %7, label %land.lhs.true.i, label %_ZN12cuda_builtinmlIfEENS_7complexIT_EERKS3_S5_.exit31 32land.lhs.true.i: ; preds = %entry33 %8 = tail call float @llvm.nvvm.fabs.f(float %add.i) #234 %9 = fcmp ugt float %8, 0x7FF000000000000035 br i1 %9, label %if.then.i, label %_ZN12cuda_builtinmlIfEENS_7complexIT_EERKS3_S5_.exit36 37if.then.i: ; preds = %land.lhs.true.i38 %10 = tail call float @llvm.nvvm.fabs.f(float %0) #239 %11 = fcmp oeq float %10, 0x7FF000000000000040 %.pre.i = tail call float @llvm.nvvm.fabs.f(float %1) #241 %12 = fcmp oeq float %.pre.i, 0x7FF000000000000042 %or.cond.i = or i1 %11, %1243 br i1 %or.cond.i, label %if.then.14.i, label %if.end.31.i44 45if.then.14.i: ; preds = %if.then.i46 %13 = bitcast float %0 to i3247 %14 = and i32 %13, -214748364848 %15 = select i1 %11, i32 1065353216, i32 049 %16 = or i32 %15, %1450 %17 = bitcast i32 %16 to float51 %18 = bitcast float %1 to i3252 %19 = and i32 %18, -214748364853 %20 = select i1 %12, i32 1065353216, i32 054 %21 = or i32 %20, %1955 %22 = bitcast i32 %21 to float56 %23 = tail call float @llvm.nvvm.fabs.f(float %2) #257 %24 = fcmp ugt float %23, 0x7FF000000000000058 br i1 %24, label %if.then.24.i, label %if.end.i59 60if.then.24.i: ; preds = %if.then.14.i61 %25 = bitcast float %2 to i3262 %26 = and i32 %25, -214748364863 %27 = bitcast i32 %26 to float64 br label %if.end.i65 66if.end.i: ; preds = %if.then.24.i, %if.then.14.i67 %__c.0.i = phi float [ %27, %if.then.24.i ], [ %2, %if.then.14.i ]68 %28 = tail call float @llvm.nvvm.fabs.f(float %3) #269 %29 = fcmp ugt float %28, 0x7FF000000000000070 br i1 %29, label %if.then.28.i, label %if.end.31.i71 72if.then.28.i: ; preds = %if.end.i73 %30 = bitcast float %3 to i3274 %31 = and i32 %30, -214748364875 %32 = bitcast i32 %31 to float76 br label %if.end.31.i77 78if.end.31.i: ; preds = %if.then.28.i, %if.end.i, %if.then.i79 %__d.1.i = phi float [ %32, %if.then.28.i ], [ %3, %if.end.i ], [ %3, %if.then.i ]80 %__c.1.i = phi float [ %__c.0.i, %if.then.28.i ], [ %__c.0.i, %if.end.i ], [ %2, %if.then.i ]81 %__b.0.i = phi float [ %22, %if.then.28.i ], [ %22, %if.end.i ], [ %1, %if.then.i ]82 %__a.0.i = phi float [ %17, %if.then.28.i ], [ %17, %if.end.i ], [ %0, %if.then.i ]83 %__recalc.0.off0.i = phi i1 [ true, %if.then.28.i ], [ true, %if.end.i ], [ false, %if.then.i ]84 %33 = tail call float @llvm.nvvm.fabs.f(float %__c.1.i) #285 %34 = fcmp oeq float %33, 0x7FF000000000000086 %.pre6.i = tail call float @llvm.nvvm.fabs.f(float %__d.1.i) #287 %35 = fcmp oeq float %.pre6.i, 0x7FF000000000000088 %or.cond8.i = or i1 %34, %3589 br i1 %or.cond8.i, label %if.then.37.i, label %if.end.56.i90 91if.then.37.i: ; preds = %if.end.31.i92 %36 = bitcast float %__c.1.i to i3293 %37 = and i32 %36, -214748364894 %38 = select i1 %34, i32 1065353216, i32 095 %39 = or i32 %38, %3796 %40 = bitcast i32 %39 to float97 %41 = bitcast float %__d.1.i to i3298 %42 = and i32 %41, -214748364899 %43 = select i1 %35, i32 1065353216, i32 0100 %44 = or i32 %43, %42101 %45 = bitcast i32 %44 to float102 %46 = tail call float @llvm.nvvm.fabs.f(float %__a.0.i) #2103 %47 = fcmp ugt float %46, 0x7FF0000000000000104 br i1 %47, label %if.then.48.i, label %if.end.50.i105 106if.then.48.i: ; preds = %if.then.37.i107 %48 = bitcast float %__a.0.i to i32108 %49 = and i32 %48, -2147483648109 %50 = bitcast i32 %49 to float110 br label %if.end.50.i111 112if.end.50.i: ; preds = %if.then.48.i, %if.then.37.i113 %__a.1.i = phi float [ %50, %if.then.48.i ], [ %__a.0.i, %if.then.37.i ]114 %51 = tail call float @llvm.nvvm.fabs.f(float %__b.0.i) #2115 %52 = fcmp ugt float %51, 0x7FF0000000000000116 br i1 %52, label %if.then.53.i, label %if.then.93.i117 118if.then.53.i: ; preds = %if.end.50.i119 %53 = bitcast float %__b.0.i to i32120 %54 = and i32 %53, -2147483648121 %55 = bitcast i32 %54 to float122 br label %if.then.93.i123 124if.end.56.i: ; preds = %if.end.31.i125 br i1 %__recalc.0.off0.i, label %if.then.93.i, label %land.lhs.true.58.i126 127land.lhs.true.58.i: ; preds = %if.end.56.i128 %56 = tail call float @llvm.nvvm.fabs.f(float %mul.i) #2129 %57 = fcmp oeq float %56, 0x7FF0000000000000130 br i1 %57, label %if.then.70.i, label %lor.lhs.false.61.i131 132lor.lhs.false.61.i: ; preds = %land.lhs.true.58.i133 %58 = tail call float @llvm.nvvm.fabs.f(float %mul4.i) #2134 %59 = fcmp oeq float %58, 0x7FF0000000000000135 br i1 %59, label %if.then.70.i, label %lor.lhs.false.64.i136 137lor.lhs.false.64.i: ; preds = %lor.lhs.false.61.i138 %60 = tail call float @llvm.nvvm.fabs.f(float %mul5.i) #2139 %61 = fcmp oeq float %60, 0x7FF0000000000000140 br i1 %61, label %if.then.70.i, label %lor.lhs.false.67.i141 142lor.lhs.false.67.i: ; preds = %lor.lhs.false.64.i143 %62 = tail call float @llvm.nvvm.fabs.f(float %mul6.i) #2144 %63 = fcmp oeq float %62, 0x7FF0000000000000145 br i1 %63, label %if.then.70.i, label %_ZN12cuda_builtinmlIfEENS_7complexIT_EERKS3_S5_.exit146 147if.then.70.i: ; preds = %lor.lhs.false.67.i, %lor.lhs.false.64.i, %lor.lhs.false.61.i, %land.lhs.true.58.i148 %64 = tail call float @llvm.nvvm.fabs.f(float %__a.0.i) #2149 %65 = fcmp ugt float %64, 0x7FF0000000000000150 br i1 %65, label %if.then.73.i, label %if.end.75.i151 152if.then.73.i: ; preds = %if.then.70.i153 %66 = bitcast float %__a.0.i to i32154 %67 = and i32 %66, -2147483648155 %68 = bitcast i32 %67 to float156 br label %if.end.75.i157 158if.end.75.i: ; preds = %if.then.73.i, %if.then.70.i159 %__a.3.i = phi float [ %68, %if.then.73.i ], [ %__a.0.i, %if.then.70.i ]160 %69 = tail call float @llvm.nvvm.fabs.f(float %__b.0.i) #2161 %70 = fcmp ugt float %69, 0x7FF0000000000000162 br i1 %70, label %if.then.78.i, label %if.end.80.i163 164if.then.78.i: ; preds = %if.end.75.i165 %71 = bitcast float %__b.0.i to i32166 %72 = and i32 %71, -2147483648167 %73 = bitcast i32 %72 to float168 br label %if.end.80.i169 170if.end.80.i: ; preds = %if.then.78.i, %if.end.75.i171 %__b.3.i = phi float [ %73, %if.then.78.i ], [ %__b.0.i, %if.end.75.i ]172 %74 = fcmp ugt float %33, 0x7FF0000000000000173 br i1 %74, label %if.then.83.i, label %if.end.85.i174 175if.then.83.i: ; preds = %if.end.80.i176 %75 = bitcast float %__c.1.i to i32177 %76 = and i32 %75, -2147483648178 %77 = bitcast i32 %76 to float179 br label %if.end.85.i180 181if.end.85.i: ; preds = %if.then.83.i, %if.end.80.i182 %__c.3.i = phi float [ %77, %if.then.83.i ], [ %__c.1.i, %if.end.80.i ]183 %78 = fcmp ugt float %.pre6.i, 0x7FF0000000000000184 br i1 %78, label %if.then.88.i, label %if.then.93.i185 186if.then.88.i: ; preds = %if.end.85.i187 %79 = bitcast float %__d.1.i to i32188 %80 = and i32 %79, -2147483648189 %81 = bitcast i32 %80 to float190 br label %if.then.93.i191 192if.then.93.i: ; preds = %if.then.88.i, %if.end.85.i, %if.end.56.i, %if.then.53.i, %if.end.50.i193 %__d.4.ph.i = phi float [ %__d.1.i, %if.end.85.i ], [ %81, %if.then.88.i ], [ %__d.1.i, %if.end.56.i ], [ %45, %if.end.50.i ], [ %45, %if.then.53.i ]194 %__c.4.ph.i = phi float [ %__c.3.i, %if.end.85.i ], [ %__c.3.i, %if.then.88.i ], [ %__c.1.i, %if.end.56.i ], [ %40, %if.end.50.i ], [ %40, %if.then.53.i ]195 %__b.4.ph.i = phi float [ %__b.3.i, %if.end.85.i ], [ %__b.3.i, %if.then.88.i ], [ %__b.0.i, %if.end.56.i ], [ %__b.0.i, %if.end.50.i ], [ %55, %if.then.53.i ]196 %__a.4.ph.i = phi float [ %__a.3.i, %if.end.85.i ], [ %__a.3.i, %if.then.88.i ], [ %__a.0.i, %if.end.56.i ], [ %__a.1.i, %if.end.50.i ], [ %__a.1.i, %if.then.53.i ]197 %mul95.i = fmul float %__c.4.ph.i, %__a.4.ph.i198 %mul96.i = fmul float %__d.4.ph.i, %__b.4.ph.i199 %sub97.i = fsub float %mul95.i, %mul96.i200 %mul98.i = fmul float %sub97.i, 0x7FF0000000000000201 %82 = bitcast float %mul98.i to i32202 %mul100.i = fmul float %__d.4.ph.i, %__a.4.ph.i203 %mul101.i = fmul float %__c.4.ph.i, %__b.4.ph.i204 %add102.i = fadd float %mul101.i, %mul100.i205 %mul103.i = fmul float %add102.i, 0x7FF0000000000000206 %83 = bitcast float %mul103.i to i32207 br label %_ZN12cuda_builtinmlIfEENS_7complexIT_EERKS3_S5_.exit208 209_ZN12cuda_builtinmlIfEENS_7complexIT_EERKS3_S5_.exit: ; preds = %if.then.93.i, %lor.lhs.false.67.i, %land.lhs.true.i, %entry210 %84 = phi i32 [ %4, %land.lhs.true.i ], [ %4, %entry ], [ %82, %if.then.93.i ], [ %4, %lor.lhs.false.67.i ]211 %85 = phi i32 [ %5, %land.lhs.true.i ], [ %5, %entry ], [ %83, %if.then.93.i ], [ %5, %lor.lhs.false.67.i ]212 %arrayidx5 = getelementptr inbounds float, ptr %f, i64 5213 store i32 %84, ptr %arrayidx5, align 4214 %arrayidx7 = getelementptr inbounds float, ptr %f, i64 6215 store i32 %85, ptr %arrayidx7, align 4216 ret void217}218 219declare float @llvm.nvvm.fabs.f(float)220