The patch adds the support of OpenCL and SPIR-V built-in types. It also implements ExtInst selection and adds spv_unreachable and spv_alloca intrinsics which improve the generation of the corresponding SPIR-V code. Five LIT tests are included to demonstrate the improvement. Differential Revision: https://reviews.llvm.org/D132648 Co-authored-by: Aleksandr Bezzubikov <zuban32s@gmail.com> Co-authored-by: Michal Paszkowski <michal.paszkowski@outlook.com> Co-authored-by: Andrey Tretyakov <andrey1.tretyakov@intel.com> Co-authored-by: Konrad Trifunovic <konrad.trifunovic@intel.com>
16 lines
463 B
LLVM
16 lines
463 B
LLVM
; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
|
|
|
|
define spir_func float @Test(float %x, float %y) {
|
|
entry:
|
|
%0 = call float @llvm.maxnum.f32(float %x, float %y)
|
|
ret float %0
|
|
}
|
|
|
|
; CHECK: OpFunction
|
|
; CHECK: %[[#x:]] = OpFunctionParameter %[[#]]
|
|
; CHECK: %[[#y:]] = OpFunctionParameter %[[#]]
|
|
; CHECK: %[[#res:]] = OpExtInst %[[#]] %[[#]] fmax %[[#x]] %[[#y]]
|
|
; CHECK: OpReturnValue %[[#res]]
|
|
|
|
declare float @llvm.maxnum.f32(float, float)
|