[CIR][NFC] Add infrastructure for AArch64 builtins (#170386)
This change adds the basic code structure for handling AArch64 builtins. The structure of this code is brought over from classic codegen to make implementing missing builtins easier. In some cases, the handling involved too much logic for a simple NFC change, so those parts were replaced with a MissingFeature assert. The actual handling for all builtins is left for later changes.
This commit is contained in:
parent
bd4c21b3c8
commit
817ab49ece
@ -190,6 +190,10 @@ struct MissingFeatures {
|
||||
static bool globalCtorAssociatedData() { return false; }
|
||||
|
||||
// Misc
|
||||
static bool aarch64SIMDIntrinsics() { return false; }
|
||||
static bool aarch64SMEIntrinsics() { return false; }
|
||||
static bool aarch64SVEIntrinsics() { return false; }
|
||||
static bool aarch64TblBuiltinExpr() { return false; }
|
||||
static bool abiArgInfo() { return false; }
|
||||
static bool addAutoInitAnnotation() { return false; }
|
||||
static bool addHeapAllocSiteMetadata() { return false; }
|
||||
@ -293,6 +297,7 @@ struct MissingFeatures {
|
||||
static bool metaDataNode() { return false; }
|
||||
static bool moduleNameHash() { return false; }
|
||||
static bool msabi() { return false; }
|
||||
static bool neonSISDIntrinsics() { return false; }
|
||||
static bool nrvo() { return false; }
|
||||
static bool objCBlocks() { return false; }
|
||||
static bool objCGC() { return false; }
|
||||
|
||||
@ -1361,9 +1361,13 @@ static mlir::Value emitTargetArchBuiltinExpr(CIRGenFunction *cgf,
|
||||
case llvm::Triple::armeb:
|
||||
case llvm::Triple::thumb:
|
||||
case llvm::Triple::thumbeb:
|
||||
// These are actually NYI, but that will be reported by emitBuiltinExpr.
|
||||
// At this point, we don't even know that the builtin is target-specific.
|
||||
return nullptr;
|
||||
case llvm::Triple::aarch64:
|
||||
case llvm::Triple::aarch64_32:
|
||||
case llvm::Triple::aarch64_be:
|
||||
return cgf->emitAArch64BuiltinExpr(builtinID, e, returnValue, arch);
|
||||
case llvm::Triple::bpfeb:
|
||||
case llvm::Triple::bpfel:
|
||||
// These are actually NYI, but that will be reported by emitBuiltinExpr.
|
||||
|
||||
1583
clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
Normal file
1583
clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@ -1236,6 +1236,14 @@ public:
|
||||
/// CIR emit functions
|
||||
/// ----------------------
|
||||
public:
|
||||
mlir::Value emitAArch64BuiltinExpr(unsigned builtinID, const CallExpr *expr,
|
||||
ReturnValueSlot returnValue,
|
||||
llvm::Triple::ArchType arch);
|
||||
mlir::Value emitAArch64SMEBuiltinExpr(unsigned builtinID,
|
||||
const CallExpr *expr);
|
||||
mlir::Value emitAArch64SVEBuiltinExpr(unsigned builtinID,
|
||||
const CallExpr *expr);
|
||||
|
||||
mlir::Value emitAlignmentAssumption(mlir::Value ptrValue, QualType ty,
|
||||
SourceLocation loc,
|
||||
SourceLocation assumptionLoc,
|
||||
|
||||
@ -12,6 +12,7 @@ add_clang_library(clangCIR
|
||||
CIRGenAtomic.cpp
|
||||
CIRGenBuilder.cpp
|
||||
CIRGenBuiltin.cpp
|
||||
CIRGenBuiltinAArch64.cpp
|
||||
CIRGenBuiltinX86.cpp
|
||||
CIRGenCall.cpp
|
||||
CIRGenClass.cpp
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user