@@ -1409,7 +1409,7 @@ PreservedAnalyses AddressSanitizerPass::run(Module &M,
1409
1409
const StackSafetyGlobalInfo *const SSGI =
1410
1410
ClUseStackSafety ? &MAM.getResult <StackSafetyGlobalAnalysis>(M) : nullptr ;
1411
1411
1412
- if (Triple (M.getTargetTriple ()).isSPIR ()) {
1412
+ if (Triple (M.getTargetTriple ()).isSPIROrSPIRV ()) {
1413
1413
bool HasESIMDKernel = false ;
1414
1414
1415
1415
// ESIMD kernel doesn't support noinline functions, so we can't
@@ -1565,7 +1565,7 @@ void AddressSanitizer::AppendDebugInfoToArgs(Instruction *InsertBefore,
1565
1565
1566
1566
Value *AddressSanitizer::memToShadow (Value *Shadow, IRBuilder<> &IRB,
1567
1567
uint32_t AddressSpace) {
1568
- if (TargetTriple.isSPIR ()) {
1568
+ if (TargetTriple.isSPIROrSPIRV ()) {
1569
1569
return IRB.CreateCall (
1570
1570
AsanMemToShadow,
1571
1571
{Shadow, ConstantInt::get (IRB.getInt32Ty (), AddressSpace)},
@@ -1718,7 +1718,7 @@ bool AddressSanitizer::isInterestingAlloca(const AllocaInst &AI) {
1718
1718
1719
1719
bool AddressSanitizer::ignoreAccess (Instruction *Inst, Value *Ptr) {
1720
1720
// SPIR has its own rules to filter the instrument accesses
1721
- if (TargetTriple.isSPIR ()) {
1721
+ if (TargetTriple.isSPIROrSPIRV ()) {
1722
1722
if (isUnsupportedSPIRAccess (Ptr, Inst->getFunction ()))
1723
1723
return true ;
1724
1724
} else {
@@ -2212,7 +2212,7 @@ void AddressSanitizer::instrumentAddress(Instruction *OrigIns,
2212
2212
Value *AddrLong = IRB.CreatePointerCast (Addr, IntptrTy);
2213
2213
if (UseCalls) {
2214
2214
if (Exp == 0 ) {
2215
- if (TargetTriple.isSPIR ()) {
2215
+ if (TargetTriple.isSPIROrSPIRV ()) {
2216
2216
SmallVector<Value *, 5 > Args;
2217
2217
Args.push_back (AddrLong);
2218
2218
AppendDebugInfoToArgs (InsertBefore, Addr, Args);
@@ -2294,7 +2294,7 @@ void AddressSanitizer::instrumentUnusualSizeOrAlignment(
2294
2294
Value *AddrLong = IRB.CreatePointerCast (Addr, IntptrTy);
2295
2295
if (UseCalls) {
2296
2296
if (Exp == 0 ) {
2297
- if (TargetTriple.isSPIR ()) {
2297
+ if (TargetTriple.isSPIROrSPIRV ()) {
2298
2298
SmallVector<Value *, 6 > Args;
2299
2299
Args.push_back (AddrLong);
2300
2300
Args.push_back (Size);
@@ -3126,7 +3126,7 @@ bool ModuleAddressSanitizer::instrumentModule(Module &M) {
3126
3126
}
3127
3127
}
3128
3128
3129
- if (TargetTriple.isSPIR ()) {
3129
+ if (TargetTriple.isSPIROrSPIRV ()) {
3130
3130
// Add module metadata "device.sanitizer" for sycl-post-link
3131
3131
LLVMContext &Ctx = M.getContext ();
3132
3132
auto *MD = M.getOrInsertNamedMetadata (" device.sanitizer" );
@@ -3189,7 +3189,7 @@ void AddressSanitizer::initializeCallbacks(Module &M, const TargetLibraryInfo *T
3189
3189
// unsigned int line,
3190
3190
// char* func
3191
3191
// )
3192
- if (TargetTriple.isSPIR ()) {
3192
+ if (TargetTriple.isSPIROrSPIRV ()) {
3193
3193
auto *Int8PtrTy =
3194
3194
Type::getInt8Ty (*C)->getPointerTo (kSpirOffloadConstantAS );
3195
3195
@@ -3250,7 +3250,7 @@ void AddressSanitizer::initializeCallbacks(Module &M, const TargetLibraryInfo *T
3250
3250
AsanShadowGlobal = M.getOrInsertGlobal (" __asan_shadow" ,
3251
3251
ArrayType::get (IRB.getInt8Ty (), 0 ));
3252
3252
3253
- if (TargetTriple.isSPIR ()) {
3253
+ if (TargetTriple.isSPIROrSPIRV ()) {
3254
3254
// __asan_set_shadow_static_local(
3255
3255
// uptr ptr,
3256
3256
// size_t size,
@@ -3375,7 +3375,7 @@ bool AddressSanitizer::instrumentFunction(Function &F,
3375
3375
if (!ClDebugFunc.empty () && ClDebugFunc == F.getName ()) return false ;
3376
3376
if (F.getName ().starts_with (" __asan_" )) return false ;
3377
3377
3378
- if (TargetTriple.isSPIR ()) {
3378
+ if (TargetTriple.isSPIROrSPIRV ()) {
3379
3379
if (F.getName ().contains (" __sycl_service_kernel__" ))
3380
3380
return false ;
3381
3381
// Skip referenced-indirectly function as we insert access to shared local
@@ -3471,7 +3471,7 @@ bool AddressSanitizer::instrumentFunction(Function &F,
3471
3471
NoReturnCalls.push_back (CB);
3472
3472
}
3473
3473
if (CallInst *CI = dyn_cast<CallInst>(&Inst)) {
3474
- if (TargetTriple.isSPIR () && CI->getCalledFunction () &&
3474
+ if (TargetTriple.isSPIROrSPIRV () && CI->getCalledFunction () &&
3475
3475
CI->getCalledFunction ()->getCallingConv () ==
3476
3476
llvm::CallingConv::SPIR_FUNC &&
3477
3477
CI->getCalledFunction ()->getName () ==
@@ -3501,7 +3501,7 @@ bool AddressSanitizer::instrumentFunction(Function &F,
3501
3501
F.getParent ()->getDataLayout (), RTCI);
3502
3502
FunctionModified = true ;
3503
3503
}
3504
- if (TargetTriple.isSPIR ()) {
3504
+ if (TargetTriple.isSPIROrSPIRV ()) {
3505
3505
for (auto *CI : SyclAllocateLocalMemoryCalls) {
3506
3506
instrumentSyclStaticLocalMemory (CI);
3507
3507
FunctionModified = true ;
@@ -4027,7 +4027,7 @@ void FunctionStackPoisoner::processStaticAllocas() {
4027
4027
// The left-most redzone has enough space for at least 4 pointers.
4028
4028
Value *BasePlus0 = IRB.CreateIntToPtr (LocalStackBase, IntptrPtrTy);
4029
4029
// SPIRV doesn't use the following metadata
4030
- if (!TargetTriple.isSPIR ()) {
4030
+ if (!TargetTriple.isSPIROrSPIRV ()) {
4031
4031
// Write the Magic value to redzone[0].
4032
4032
IRB.CreateStore (ConstantInt::get (IntptrTy, kCurrentStackFrameMagic ),
4033
4033
BasePlus0);
0 commit comments