The patch contains target lowering for SPIRV. Also it implements TargetMachine and AsmPrinter.
The updated patch fixes builds with shared libs, which Fangrui Song proposed to check. This patch does not cause "x64 debian fail" (9 failed tests in libarcher :: races) since I see other builds that fail with the same issue.
It's the same thing, not much difference. It's not worth defining SPIRCallingConv.td just for this
Why is there a fallback to 8? Why not just switch or check if 64?
Should this be removed then?
In SPIR-V spec composite returns/formal args are allowed. In the case of composites we need to keep the original type info and to avoid lowering of composite regs to multiple scalar regs. To achieve this we introduce a pass (it's not included in this series) before IR translation which clones such functions with composite returns/args to functions with scalar returns/args and keeps composite type info in metadata. So at the moment of CallLowering invocation we always expect VRegs size=1.
In fact, we have one more target ("logical") and this 8 relates to it. However it is not included in this series, so I'll remove this fallback.
You are right, I missed that it is the default behavior.
We have LIT tests with composite returns/args, but I'm afraid it's rather difficult to use them at the stage of this patch series, because the required functionality is not yet included and all the tests will fail.
Just return 0.
Is this stub necessary?
This applies to many files.
Delete print in the unreachable branch.
It's still needed, otherwise CallLowering fails inside getVectorTypeBreakdown on some tests which passes/returns <3 x i1> vectors. Once it's supported by default code, we'll remove this hacks.
I was on a trip for one week.
Can you verify this is unreachable? If it's unimplemented, you may call report_fatal_error
The convention is to add isSPIRV (see isX86) and use it.
I'd omit blank lines among these getter functions. aarch64/riscv use the compact style.
Delete unneeded default ctor
The 3 functions need a comment. Using a non-data section seems weird to readers.
@MaskRay, thanks for your comments. I'll fix the issues later today.
Yes, but Arg is used in the next 5th patch so the warning disappears. I guess it's acceptable to leave this until the 5th patch application, isn't it?
Ok, I'll add a comment saying that all contents of SPIRV file are instructions, so we put everything in a text section.
At the current stage we are not going to support branch optimization. But I admit that this may be implemented in the future, so let's change it to report_fatal_error.