@@ -536,7 +536,6 @@ bool SYCLGenBase::emitBuiltinType(const InlineAsmBuiltinType *T) {
536536 case InlineAsmBuiltinType::u16x2: OS () << MapNames::getClNamespace () + " ushort2" ; break ;
537537 case InlineAsmBuiltinType::bf16 : OS () << MapNames::getClNamespace () + " ext::oneapi::bfloat16" ; break ;
538538 case InlineAsmBuiltinType::f16x2: OS () << MapNames::getClNamespace () + " half2" ; break ;
539- case InlineAsmBuiltinType::voidType: OS () << " void" ; break ;
540539 case InlineAsmBuiltinType::e4m3:
541540 case InlineAsmBuiltinType::e5m2:
542541 case InlineAsmBuiltinType::tf32:
@@ -591,7 +590,7 @@ bool SYCLGenBase::emitVariableDeclaration(const InlineAsmVarDecl *D) {
591590bool SYCLGenBase::emitAddressExpr (const InlineAsmAddressExpr *Dst) {
592591 // Address expression only support ld/st & atom instructions.
593592 if (!CurrInst || !CurrInst->is (asmtok::op_st, asmtok::op_ld, asmtok::op_atom,
594- asmtok::op_prefetch))
593+ asmtok::op_prefetch, asmtok::op_prefetchu ))
595594 return SYCLGenError ();
596595 std::string Type;
597596 if (tryEmitType (Type, CurrInst->getType (0 )))
@@ -619,7 +618,8 @@ bool SYCLGenBase::emitAddressExpr(const InlineAsmAddressExpr *Dst) {
619618 std::string Reg;
620619 if (tryEmitStmt (Reg, Dst->getSymbol ()))
621620 return SYCLGenSuccess ();
622- if (CurrInst->is (asmtok::op_prefetch) || CanSuppressCast (Dst->getSymbol ()))
621+ if (CurrInst->is (asmtok::op_prefetch, asmtok::op_prefetchu) ||
622+ CanSuppressCast (Dst->getSymbol ()))
623623 OS () << llvm::formatv (" {0}" , Reg);
624624 else
625625 OS () << llvm::formatv (" (({0} *)(uintptr_t){1})" , Type, Reg);
@@ -1284,12 +1284,15 @@ class SYCLGen : public SYCLGenBase {
12841284 }
12851285
12861286 bool handle_prefetch (const InlineAsmInstruction *Inst) override {
1287- if (Inst->getNumInputOperands () != 1 )
1287+ if (! DpctGlobalInfo::useExtPrefetch () || Inst->getNumInputOperands () != 1 )
12881288 return SYCLGenError ();
12891289
12901290 AsmStateSpace SS = Inst->getStateSpace ();
1291- if (SS != AsmStateSpace::S_global && SS != AsmStateSpace::none)
1292- return SYCLGenError ();
1291+ if (SS != AsmStateSpace::S_global && SS != AsmStateSpace::none) {
1292+ report (Diagnostics::API_NOT_MIGRATED, /* UseTextBegin=*/ true ,
1293+ GAS->getAsmString ()->getString ());
1294+ return SYCLGenSuccess ();
1295+ }
12931296
12941297 if (!(Inst->hasAttr (InstAttr::L1) || Inst->hasAttr (InstAttr::L2)))
12951298 return SYCLGenError ();
@@ -1299,8 +1302,18 @@ class SYCLGen : public SYCLGenBase {
12991302 PrefetchHint = " L1" ;
13001303 else if (Inst->hasAttr (InstAttr::L2))
13011304 PrefetchHint = " L2" ;
1302- else
1303- return SYCLGenError ();
1305+
1306+ std::string evictionHint = " " ;
1307+ if (Inst->hasAttr (InstAttr::evict_last))
1308+ evictionHint = " evict_last" ;
1309+ else if (Inst->hasAttr (InstAttr::evict_normal))
1310+ evictionHint = " evict_normal" ;
1311+
1312+ if (!evictionHint.empty ()) {
1313+ report (Diagnostics::API_NOT_MIGRATED, /* UseTextBegin=*/ true ,
1314+ GAS->getAsmString ()->getString ());
1315+ return SYCLGenSuccess ();
1316+ }
13041317
13051318 llvm::SaveAndRestore<const InlineAsmInstruction *> Store (CurrInst);
13061319 CurrInst = Inst;
@@ -1320,6 +1333,15 @@ class SYCLGen : public SYCLGenBase {
13201333 return SYCLGenSuccess ();
13211334 }
13221335
1336+ bool handle_prefetchu (const InlineAsmInstruction *Inst) override {
1337+ if (!DpctGlobalInfo::useExtPrefetch ())
1338+ return SYCLGenError ();
1339+
1340+ report (Diagnostics::API_NOT_MIGRATED, /* UseTextBegin=*/ true ,
1341+ GAS->getAsmString ()->getString ());
1342+ return SYCLGenSuccess ();
1343+ }
1344+
13231345 StringRef GetWiderTypeAsString (const InlineAsmBuiltinType *Type) const {
13241346 switch (Type->getKind ()) {
13251347 case InlineAsmBuiltinType::s16:
0 commit comments