We are discussing how we rectify the design of address space that currently mimics the one in LLVM IR in the PR #682. There are two options:
To derive the abstraction from the frontend's clang::LangAS, which models the source language more precisely. This is the solution B discussed in #682 proposed by Bruno.
Modify some aspects in the original design of LangAS to avoid some semantic noises in ClangIR. This is formulated as an RFC on our discourse.
There's a draft PR #692 implementing the common base of both options.
This is closely related to the alloca address space in SPIR-V target. More details see also Goal 2.
Goal 2: Add SPIR-V target to CIRGen
Status: Partially Done
671
Currently we are coordinating this goal with the WIP TargetLowering library (TODO: Link to another overview issue) from @sitio-couto . We shall especially depend on the progress of CallingConvAttr.
Besides, a more direct block is that the frontend's using LangAS::FirstTargetAddressSpace as the alloca address space in SPIR-V, rather than LangAS::Default like other targets. Such behavior leads to some NYIs whose implementations cannot be tested directly. More details provided in #671.
We made it incremental, that is merging a PR with getAllocaAddressSpace unimplemented. For improvement, we are to rectify the design of address space as stated in Goal 1. After finishing it, we can use the corresponding alloca address space for getAllocaAddressSpace method.
Further more, the target-specific address space map is not available during lowering to LLVM, blocking the usages of address spaces like opencl_global. The test cases for it were marked XFAIL in #692 .
Goal 3: Support OpenCL vector types
Status: Done
532
613
674
615
685
667
This is a rather independent feature, which also leaves several future works like the issues at the end of the list.
Goal 4: Emit OpenCL kernel and module metadata
Status: WIP
705
As pointed out in this thread, MLIR prefers structured and well-defined attributes rather than a large dictionary like LLVM Metadata. We shall design something like OpenCLKernelArgMetadataAttr.
Now OpenCLKernelMetadataAttr is completed and ready for review.
This is the overview issue for the GSoC project Compile GPU kernels using ClangIR.
Participant: @seven-mile
Mentors: @jopperm @Naghasan @bcardosolopes
Goal 1: Teach CIR pointers about address space
Status: WIP
418
606
652
673
672
682
692
We are discussing how we rectify the design of address space that currently mimics the one in LLVM IR in the PR #682. There are two options:
clang::LangAS
, which models the source language more precisely. This is the solution B discussed in #682 proposed by Bruno.LangAS
to avoid some semantic noises in ClangIR. This is formulated as an RFC on our discourse.There's a draft PR #692 implementing the common base of both options.
This is closely related to the alloca address space in SPIR-V target. More details see also Goal 2.
Goal 2: Add SPIR-V target to CIRGen
Status: Partially Done
671
Currently we are coordinating this goal with the WIP TargetLowering library (TODO: Link to another overview issue) from @sitio-couto . We shall especially depend on the progress of
CallingConvAttr
.Besides, a more direct block is that the frontend's using
LangAS::FirstTargetAddressSpace
as the alloca address space in SPIR-V, rather thanLangAS::Default
like other targets. Such behavior leads to some NYIs whose implementations cannot be tested directly. More details provided in #671.We made it incremental, that is merging a PR with
getAllocaAddressSpace
unimplemented. For improvement, we are to rectify the design of address space as stated in Goal 1. After finishing it, we can use the corresponding alloca address space forgetAllocaAddressSpace
method.Further more, the target-specific address space map is not available during lowering to LLVM, blocking the usages of address spaces like
opencl_global
. The test cases for it were marked XFAIL in #692 .Goal 3: Support OpenCL vector types
Status: Done
532
613
674
615
685
667
This is a rather independent feature, which also leaves several future works like the issues at the end of the list.
Goal 4: Emit OpenCL kernel and module metadata
Status: WIP
705
As pointed out in this thread, MLIR prefers structured and well-defined attributes rather than a large dictionary like LLVM Metadata. We shall design something like
OpenCLKernelArgMetadataAttr
.Now
OpenCLKernelMetadataAttr
is completed and ready for review.Goal 5: Support OpenCL built-ins
Status: Blocked by Goal 2