brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 4da57f8 Raw
30 lines · plain
1; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s2; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s3; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}4; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}5 6; Make sure we don't pattern match to faceforward in OpenCL.7 8; CHECK-DAG: %[[#op_ext_glsl:]] = OpExtInstImport "OpenCL.std"9 10; CHECK-DAG: %[[#float_32:]] = OpTypeFloat 3211; CHECK-DAG: %[[#bool:]] = OpTypeBool12; CHECK-DAG: %[[#zero:]] = OpConstantNull %[[#float_32]]13 14define internal noundef float @faceforward_no_instcombine_float(float noundef %a, float noundef %b, float noundef %c) {15entry:16  ; CHECK: %[[#]] = OpFunction %[[#float_32]] None %[[#]]17  ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#float_32]]18  ; CHECK: %[[#arg1:]] = OpFunctionParameter %[[#float_32]]19  ; CHECK: %[[#arg2:]] = OpFunctionParameter %[[#float_32]]20  ; CHECK: %[[#fmul:]] = OpFMul %[[#float_32]] %[[#arg1]] %[[#arg2]]21  ; CHECK: %[[#fcmp:]] = OpFOrdLessThan %[[#bool]] %[[#fmul]] %[[#zero]]22  ; CHECK: %[[#fneg:]] = OpFNegate %[[#float_32]] %[[#arg0]]23  ; CHECK: %[[#select:]] = OpSelect %[[#float_32]] %[[#fcmp]] %[[#arg0]] %[[#fneg]]24  %fmul= fmul float %b, %c25  %fcmp = fcmp olt float %fmul, 0.000000e+0026  %fneg = fneg float %a27  %select = select i1 %fcmp, float %a, float %fneg28  ret float %select29 } 30