This patch contains enough for lib/Target/SPIRV to compile: a basic SPIRVTargetMachine and SPIRVTargetInfo.
Triples for SPIRV were recently added (see D109144).
Differential D115009
[SPIRV 1/6] Add stub for SPIRV backend iliya-diyachkov on Dec 2 2021, 4:36 PM. Authored by
Details This patch contains enough for lib/Target/SPIRV to compile: a basic SPIRVTargetMachine and SPIRVTargetInfo. Triples for SPIRV were recently added (see D109144).
Diff Detail
Event TimelineComment Actions I don't see any recent discussion of this project on llvm-dev. Please make sure you send an email to llvm-dev stating your plan to land an experimental SPIRV target, and explains how it meets the requirements outlined at https://llvm.org/docs/DeveloperPolicy.html#adding-a-new-target . (I don't see any issue meeting those requirements, but let's make sure everyone is on the same page.) Comment Actions Just to clarify, the high level design for the proposal has been sent to llvm-dev in March this year. https://lists.llvm.org/pipermail/llvm-dev/2021-March/148905.html But I agree, we should send some heads up announcement that we are starting to land patches and they are going to be an experimental backend. Comment Actions Ilya has posted an official RFC announcing the upstream of SPIR-V backend as an experimental target: Comment Actions You could mark the other revisions as child revisions with Edit Related Revisions... at the top right. Comment Actions Hi, I only saw that now. In addition to adding the rest of the reviews as a child to this one, can you also please number them accordingly? Please use 1/10, 2/10, etc. instead of 1/n, 2/n. It makes no sense to have a '/n'. Also, make sure that the last patch allows the target to do something substantial (with tests), for example, parse/lower assembly instructions, lower a simple function with return, etc. Once the first series is complete, you don't need to number the patches any more. That's the whole point of the '/n', to separate the before, where nothing works, with the after, where things progressively work better. Finally, just a reminder that you should not merge any patch in the initial series until *all* patches in the series have been approved. This is crucial to avoid reverting patches on a half-implemented back-end. Thanks! Comment Actions Hi Renato. Great thanks for your clear explanation! We'll rename the patches and provide the complete series for review. Comment Actions Other than the regular -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=on builds, it's good to ensure a few others work:
Comment Actions Thank you to everyone for all the suggestions and feedback. In the recent weeks we have resolved all the comments and submitted all the necessary fixes to the initial six submitted patches:
Right now all the patches are passing buildbot builds and checks (with the exception of a single clang-format comment on the common across all targets Triple.cpp file in the third patch). We would love to ask you for the final review and LGTM of the backend stub and the six patches above as a whole, so we will be able to push the changes to the trunk soon. Comment Actions I also want to express my gratitude to the reviewers. In addition to the regular builds, I also checked the special ones that Fengrui Song listed earlier (all with and without -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV). I fixed a few issues in the 3th-6th patches, so now all additional builds (as well as the regular ones) are build-able, and built llcs successfully pass LIT testing (including added SPIRV's LIT tests). We look forward to the final feedback or further comments on the code. Comment Actions This looks good to me as the first patch. If others still have comments, please don't shy on posting them. If not, feel free to approve, too. |
Don’t need .hasValue()