This patch adds one SPIRV analysis pass and extends AsmPrinter. It is essential for minimum SPIR-V output. Also it adds several simplest tests to show that the target basically works. Differential Revision: https://reviews.llvm.org/D116465 Authors: Aleksandr Bezzubikov, Lewis Crawford, Ilia Diachkov, Michal Paszkowski, Andrey Tretyakov, Konrad Trifunovic Co-authored-by: Aleksandr Bezzubikov <zuban32s@gmail.com> Co-authored-by: Ilia Diachkov <iliya.diyachkov@intel.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>
28 lines
855 B
LLVM
28 lines
855 B
LLVM
; RUN: llc -O0 %s -o - | FileCheck %s
|
|
|
|
target triple = "spirv32-unknown-unknown"
|
|
|
|
; Debug info:
|
|
; CHECK: OpName [[FOO:%.+]] "foo"
|
|
|
|
; Types:
|
|
; CHECK: [[VOID:%.+]] = OpTypeVoid
|
|
; CHECK: [[FN:%.+]] = OpTypeFunction [[VOID]]
|
|
|
|
; Functions:
|
|
; CHECK: [[FOO]] = OpFunction [[VOID]] None [[FN]]
|
|
; CHECK-NOT: OpFunctionParameter
|
|
; NOTE: In 2.4, it isn't explicitly written that a function always has a least
|
|
; one block. In fact, 2.4.11 seems to imply that there are at least two
|
|
; blocks in functions with a body, but that doesn't make much sense.
|
|
; However, in order to distinguish between function declaration and
|
|
; definition, a function needs at least one block, hence why this test
|
|
; expects one OpLabel + OpReturn.
|
|
; CHECK: OpLabel
|
|
; CHECK: OpReturn
|
|
; CHECK-NOT: OpLabel
|
|
; CHECK: OpFunctionEnd
|
|
define void @foo() {
|
|
ret void
|
|
}
|