Skip to content

Commit 817ab49

Browse files
authored
[CIR][NFC] Add infrastructure for AArch64 builtins (llvm#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.
1 parent bd4c21b commit 817ab49

File tree

5 files changed

+1601
-0
lines changed

5 files changed

+1601
-0
lines changed

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ struct MissingFeatures {
190190
static bool globalCtorAssociatedData() { return false; }
191191

192192
// Misc
193+
static bool aarch64SIMDIntrinsics() { return false; }
194+
static bool aarch64SMEIntrinsics() { return false; }
195+
static bool aarch64SVEIntrinsics() { return false; }
196+
static bool aarch64TblBuiltinExpr() { return false; }
193197
static bool abiArgInfo() { return false; }
194198
static bool addAutoInitAnnotation() { return false; }
195199
static bool addHeapAllocSiteMetadata() { return false; }
@@ -293,6 +297,7 @@ struct MissingFeatures {
293297
static bool metaDataNode() { return false; }
294298
static bool moduleNameHash() { return false; }
295299
static bool msabi() { return false; }
300+
static bool neonSISDIntrinsics() { return false; }
296301
static bool nrvo() { return false; }
297302
static bool objCBlocks() { return false; }
298303
static bool objCGC() { return false; }

clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,9 +1361,13 @@ static mlir::Value emitTargetArchBuiltinExpr(CIRGenFunction *cgf,
13611361
case llvm::Triple::armeb:
13621362
case llvm::Triple::thumb:
13631363
case llvm::Triple::thumbeb:
1364+
// These are actually NYI, but that will be reported by emitBuiltinExpr.
1365+
// At this point, we don't even know that the builtin is target-specific.
1366+
return nullptr;
13641367
case llvm::Triple::aarch64:
13651368
case llvm::Triple::aarch64_32:
13661369
case llvm::Triple::aarch64_be:
1370+
return cgf->emitAArch64BuiltinExpr(builtinID, e, returnValue, arch);
13671371
case llvm::Triple::bpfeb:
13681372
case llvm::Triple::bpfel:
13691373
// These are actually NYI, but that will be reported by emitBuiltinExpr.

0 commit comments

Comments
 (0)