This revision was automatically updated to reflect the committed changes. Closed by commit rGf730749e8584: [clang] [ARM] Add __builtin_sponentry like on aarch64 (authored by mstorsjo).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126764/new/ https://reviews.llvm.org/D126764 Files: clang/include/clang/Basic/BuiltinsARM.def clang/lib/CodeGen/CGBuiltin.cpp clang/test/CodeGen/builtin-sponentry.c Index: clang/test/CodeGen/builtin-sponentry.c =================================================================== --- clang/test/CodeGen/builtin-sponentry.c +++ clang/test/CodeGen/builtin-sponentry.c @@ -1,8 +1,9 @@ // RUN: %clang_cc1 -no-opaque-pointers -triple aarch64-windows-gnu -Oz -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -no-opaque-pointers -triple thumbv7-windows-gnu -Oz -emit-llvm %s -o - | FileCheck %s void *test_sponentry(void) { return __builtin_sponentry(); } -// CHECK-LABEL: define dso_local i8* @test_sponentry() +// CHECK-LABEL: define dso_local {{(arm_aapcs_vfpcc )?}}i8* @test_sponentry() // CHECK: = tail call i8* @llvm.sponentry.p0i8() // CHECK: ret i8* Index: clang/lib/CodeGen/CGBuiltin.cpp =================================================================== --- clang/lib/CodeGen/CGBuiltin.cpp +++ clang/lib/CodeGen/CGBuiltin.cpp @@ -7783,6 +7783,11 @@ AccessKind); } + if (BuiltinID == ARM::BI__builtin_sponentry) { + llvm::Function *F = CGM.getIntrinsic(Intrinsic::sponentry, AllocaInt8PtrTy); + return Builder.CreateCall(F); + } + // Handle MSVC intrinsics before argument evaluation to prevent double // evaluation. if (Optional<MSVCIntrin> MsvcIntId = translateArmToMsvcIntrin(BuiltinID)) Index: clang/include/clang/Basic/BuiltinsARM.def =================================================================== --- clang/include/clang/Basic/BuiltinsARM.def +++ clang/include/clang/Basic/BuiltinsARM.def @@ -197,6 +197,9 @@ BUILTIN(__builtin_arm_wsr64, "vcC*LLUi", "nc") BUILTIN(__builtin_arm_wsrp, "vcC*vC*", "nc") +// Misc +BUILTIN(__builtin_sponentry, "v*", "c") + // Builtins for implementing ACLE MVE intrinsics. (Unlike NEON, these // don't need to live in a separate BuiltinsMVE.def, because they // aren't included from both here and BuiltinsAArch64.def.)
Index: clang/test/CodeGen/builtin-sponentry.c =================================================================== --- clang/test/CodeGen/builtin-sponentry.c +++ clang/test/CodeGen/builtin-sponentry.c @@ -1,8 +1,9 @@ // RUN: %clang_cc1 -no-opaque-pointers -triple aarch64-windows-gnu -Oz -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -no-opaque-pointers -triple thumbv7-windows-gnu -Oz -emit-llvm %s -o - | FileCheck %s void *test_sponentry(void) { return __builtin_sponentry(); } -// CHECK-LABEL: define dso_local i8* @test_sponentry() +// CHECK-LABEL: define dso_local {{(arm_aapcs_vfpcc )?}}i8* @test_sponentry() // CHECK: = tail call i8* @llvm.sponentry.p0i8() // CHECK: ret i8* Index: clang/lib/CodeGen/CGBuiltin.cpp =================================================================== --- clang/lib/CodeGen/CGBuiltin.cpp +++ clang/lib/CodeGen/CGBuiltin.cpp @@ -7783,6 +7783,11 @@ AccessKind); } + if (BuiltinID == ARM::BI__builtin_sponentry) { + llvm::Function *F = CGM.getIntrinsic(Intrinsic::sponentry, AllocaInt8PtrTy); + return Builder.CreateCall(F); + } + // Handle MSVC intrinsics before argument evaluation to prevent double // evaluation. if (Optional<MSVCIntrin> MsvcIntId = translateArmToMsvcIntrin(BuiltinID)) Index: clang/include/clang/Basic/BuiltinsARM.def =================================================================== --- clang/include/clang/Basic/BuiltinsARM.def +++ clang/include/clang/Basic/BuiltinsARM.def @@ -197,6 +197,9 @@ BUILTIN(__builtin_arm_wsr64, "vcC*LLUi", "nc") BUILTIN(__builtin_arm_wsrp, "vcC*vC*", "nc") +// Misc +BUILTIN(__builtin_sponentry, "v*", "c") + // Builtins for implementing ACLE MVE intrinsics. (Unlike NEON, these // don't need to live in a separate BuiltinsMVE.def, because they // aren't included from both here and BuiltinsAArch64.def.)
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits