@@ -743,6 +743,10 @@ mlir::Type CIRGenTypes::ConvertType(QualType T) {
743
743
return ResultType;
744
744
}
745
745
746
+ namespace cir {
747
+ void computeSPIRKernelABIInfo (CIRGenModule &CGM, CIRGenFunctionInfo &FI);
748
+ } // namespace cir
749
+
746
750
const CIRGenFunctionInfo &CIRGenTypes::arrangeCIRFunctionInfo (
747
751
CanQualType resultType, FnInfoOpts opts,
748
752
llvm::ArrayRef<CanQualType> argTypes, FunctionType::ExtInfo info,
@@ -774,11 +778,16 @@ const CIRGenFunctionInfo &CIRGenTypes::arrangeCIRFunctionInfo(
774
778
(void )inserted;
775
779
assert (inserted && " Recursively being processed?" );
776
780
777
- // Compute ABI inforamtion.
778
- assert (info.getCC () != clang::CallingConv::CC_SpirFunction && " NYI" );
779
- assert (info.getCC () != CC_Swift && info.getCC () != CC_SwiftAsync &&
780
- " Swift NYI" );
781
- getABIInfo ().computeInfo (*FI);
781
+ // Compute ABI information.
782
+ if (CC == mlir::cir::CallingConv::SpirKernel) {
783
+ // Force target independent argument handling for the host visible
784
+ // kernel functions.
785
+ computeSPIRKernelABIInfo (CGM, *FI);
786
+ } else if (info.getCC () == CC_Swift || info.getCC () == CC_SwiftAsync) {
787
+ llvm_unreachable (" Swift NYI" );
788
+ } else {
789
+ getABIInfo ().computeInfo (*FI);
790
+ }
782
791
783
792
// Loop over all of the computed argument and return value info. If any of
784
793
// them are direct or extend without a specified coerce type, specify the
0 commit comments