Skip to content

Commit eff16c9

Browse files
Removed unsupported AI migration test cases
1 parent c2c263a commit eff16c9

File tree

10 files changed

+6
-169
lines changed

10 files changed

+6
-169
lines changed

clang/lib/DPCT/RulesAsm/AsmMigration.cpp

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ bool SYCLGenBase::emitVariableDeclaration(const InlineAsmVarDecl *D) {
590590
bool SYCLGenBase::emitAddressExpr(const InlineAsmAddressExpr *Dst) {
591591
// Address expression only support ld/st & atom instructions.
592592
if (!CurrInst || !CurrInst->is(asmtok::op_st, asmtok::op_ld, asmtok::op_atom,
593-
asmtok::op_prefetch, asmtok::op_prefetchu))
593+
asmtok::op_prefetch))
594594
return SYCLGenError();
595595
std::string Type;
596596
if (tryEmitType(Type, CurrInst->getType(0)))
@@ -618,8 +618,7 @@ bool SYCLGenBase::emitAddressExpr(const InlineAsmAddressExpr *Dst) {
618618
std::string Reg;
619619
if (tryEmitStmt(Reg, Dst->getSymbol()))
620620
return SYCLGenSuccess();
621-
if (CurrInst->is(asmtok::op_prefetch, asmtok::op_prefetchu) ||
622-
CanSuppressCast(Dst->getSymbol()))
621+
if (CurrInst->is(asmtok::op_prefetch) || CanSuppressCast(Dst->getSymbol()))
623622
OS() << llvm::formatv("{0}", Reg);
624623
else
625624
OS() << llvm::formatv("(({0} *)(uintptr_t){1})", Type, Reg);
@@ -1289,9 +1288,7 @@ class SYCLGen : public SYCLGenBase {
12891288

12901289
AsmStateSpace SS = Inst->getStateSpace();
12911290
if (SS != AsmStateSpace::S_global && SS != AsmStateSpace::none) {
1292-
report(Diagnostics::API_NOT_MIGRATED, /*UseTextBegin=*/true,
1293-
GAS->getAsmString()->getString());
1294-
return SYCLGenSuccess();
1291+
return SYCLGenError();
12951292
}
12961293

12971294
if (!(Inst->hasAttr(InstAttr::L1) || Inst->hasAttr(InstAttr::L2)))
@@ -1303,24 +1300,12 @@ class SYCLGen : public SYCLGenBase {
13031300
else if (Inst->hasAttr(InstAttr::L2))
13041301
PrefetchHint = "L2";
13051302

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-
}
1317-
13181303
llvm::SaveAndRestore<const InlineAsmInstruction *> Store(CurrInst);
13191304
CurrInst = Inst;
13201305
const auto *Src =
13211306
dyn_cast_or_null<InlineAsmAddressExpr>(Inst->getInputOperand(0));
13221307
if (!Src)
1323-
return false;
1308+
return SYCLGenError();
13241309

13251310
OS() << MapNames::getExpNamespace() << "prefetch(";
13261311
if (emitStmt(Src))
@@ -1333,15 +1318,6 @@ class SYCLGen : public SYCLGenBase {
13331318
return SYCLGenSuccess();
13341319
}
13351320

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-
13451321
StringRef GetWiderTypeAsString(const InlineAsmBuiltinType *Type) const {
13461322
switch (Type->getKind()) {
13471323
case InlineAsmBuiltinType::s16:

clang/lib/DPCT/RulesAsm/Parser/AsmLexer.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,6 @@ bool InlineAsmLexer::lexTokenInternal(InlineAsmToken &Result) {
265265
Char = getChar(CurPtr);
266266
if (Char == ':') {
267267
CurPtr++;
268-
Char = getChar(CurPtr);
269-
if (isIdentifierStart(Char) || isDigit(Char)) {
270-
Result.setFlag(InlineAsmToken::StartOfColonColon);
271-
return lexIdentifierContinue(Result, CurPtr);
272-
}
273268
Kind = asmtok::coloncolon;
274269
} else {
275270
Kind = asmtok::colon;

clang/lib/DPCT/RulesAsm/Parser/AsmParser.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ InlineAsmStmtResult InlineAsmParser::ParseInstruction() {
335335
SmallVector<InlineAsmExpr *, 4> Ops;
336336
std::optional<AsmStateSpace> StateSpace;
337337

338-
while (Tok.startOfDot() || Tok.startOfColonColon()) {
338+
while (Tok.startOfDot()) {
339339
switch (Tok.getIdentifier()->getFlags()) {
340340
case InlineAsmIdentifierInfo::BuiltinType:
341341
Types.push_back(Context.getBuiltinTypeFromTokenKind(Tok.getKind()));
@@ -356,11 +356,6 @@ InlineAsmStmtResult InlineAsmParser::ParseInstruction() {
356356
ConsumeToken(); // consume instruction attribute
357357
}
358358

359-
if (Tok.getKind() == asmtok::coloncolon) {
360-
Attrs.push_back(ConvertToInstAttr(Tok.getKind()));
361-
ConsumeToken();
362-
}
363-
364359
InlineAsmExprResult Pred, Out;
365360
if ((Out = ParseExpression()).isInvalid())
366361
return AsmStmtError();
@@ -383,8 +378,7 @@ InlineAsmStmtResult InlineAsmParser::ParseInstruction() {
383378
Out = nullptr;
384379
}
385380
// prefetch{.state}.{level} [%0] has only one input operand and no type.
386-
if (Opcode->getTokenID() == asmtok::op_prefetch ||
387-
Opcode->getTokenID() == asmtok::op_prefetchu) {
381+
if (Opcode->getTokenID() == asmtok::op_prefetch) {
388382
Ops.push_back(Out.get());
389383
Out = nullptr;
390384
Types.push_back(Context.getBuiltinType(InlineAsmBuiltinType::byte));

clang/lib/DPCT/RulesAsm/Parser/AsmTokenKinds.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,6 @@ MODIFIER(sc, ".sc")
406406
MODIFIER(gl, ".gl")
407407
MODIFIER(L1, ".L1")
408408
MODIFIER(L2, ".L2")
409-
MODIFIER(tensormap, ".tensormap")
410-
MODIFIER(evict_last, "::evict_last")
411-
MODIFIER(evict_normal, "::evict_normal")
412409

413410

414411
#undef LINKAGE

clang/lib/DPCT/SrcAPI/APINames_ASM.inc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ ENTRY("or", "or", true, NO_FLAG, P1, "Successful")
101101
ENTRY("pmevent", "pmevent", false, NO_FLAG, P1, "Comment")
102102
ENTRY("popc", "popc", true, NO_FLAG, P1, "Successful")
103103
ENTRY("prefetch", "prefetch", true, NO_FLAG, P1, "Partial")
104-
ENTRY("prefetchu", "prefetchu", true, NO_FLAG, P1, "Partial")
105104
ENTRY("prmt", "prmt", false, NO_FLAG, P1, "Comment")
106105
ENTRY("rcp", "rcp", true, NO_FLAG, P1, "Successful")
107106
ENTRY("red", "red", false, NO_FLAG, P1, "Comment")

clang/test/dpct/asm/prefetch.cu

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,6 @@ __global__ void prefetch(int *arr) {
4040
/* using Register-Immediate (Displacement) address mode */
4141
// CHECK: sycl::ext::oneapi::experimental::prefetch(((uint8_t *)((uintptr_t)arr + 2)), sycl::ext::oneapi::experimental::properties{sycl::ext::oneapi::experimental::prefetch_hint_L1});
4242
asm volatile("prefetch.global.L1 [%0 + 2];" :: "l"(arr));
43-
44-
#ifndef BUILD_TEST
45-
/* prefetch of global address space with eviction priority */
46-
// CHECK: /*
47-
// CHECK-NEXT: DPCT1007:{{.*}} Migration of prefetch.global.L2::evict_last [%0]; is not supported.
48-
// CHECK-NEXT: */
49-
asm volatile ("prefetch.global.L2::evict_last [%0];" : : "l"(arr));
50-
// CHECK: /*
51-
// CHECK-NEXT: DPCT1007:{{.*}} Migration of prefetch.global.L2::evict_normal [%0]; is not supported.
52-
// CHECK-NEXT: */
53-
asm volatile ("prefetch.global.L2::evict_normal [%0];" : : "l"(arr));
54-
55-
/* prefetch of local address space */
56-
// CHECK: /*
57-
// CHECK-NEXT: DPCT1007:{{.*}} Migration of prefetch.local.L1 [%0]; is not supported.
58-
// CHECK-NEXT: */
59-
asm volatile ("prefetch.local.L1 [%0];" : : "l"(arr));
60-
// CHECK: /*
61-
// CHECK-NEXT: DPCT1007:{{.*}} Migration of prefetch.local.L2 [%0]; is not supported.
62-
// CHECK-NEXT: */
63-
asm volatile ("prefetch.local.L2 [%0];" : : "l"(arr));
64-
#endif // BUILD_TEST
6543
}
6644

6745
// clang-format on

clang/test/dpct/asm/prefetch_eviction_priority.cu

Lines changed: 0 additions & 28 deletions
This file was deleted.

clang/test/dpct/asm/prefetch_tensormap.cu

Lines changed: 0 additions & 28 deletions
This file was deleted.

clang/test/dpct/asm/prefetchu.cu

Lines changed: 0 additions & 23 deletions
This file was deleted.

clang/test/dpct/asm/prefetchu_default.cu

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)