Skip to content

Commit

Permalink
Removed unsupported AI migration test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
TejaX-Alaghari committed Jan 4, 2025
1 parent a19db82 commit 758c8fb
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 146 deletions.
24 changes: 5 additions & 19 deletions clang/lib/DPCT/RulesAsm/AsmMigration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ bool SYCLGenBase::emitVariableDeclaration(const InlineAsmVarDecl *D) {
bool SYCLGenBase::emitAddressExpr(const InlineAsmAddressExpr *Dst) {
// Address expression only support ld/st & atom instructions.
if (!CurrInst || !CurrInst->is(asmtok::op_st, asmtok::op_ld, asmtok::op_atom,
asmtok::op_prefetch, asmtok::op_prefetchu))
asmtok::op_prefetch))
return SYCLGenError();
std::string Type;
if (tryEmitType(Type, CurrInst->getType(0)))
Expand Down Expand Up @@ -618,8 +618,7 @@ bool SYCLGenBase::emitAddressExpr(const InlineAsmAddressExpr *Dst) {
std::string Reg;
if (tryEmitStmt(Reg, Dst->getSymbol()))
return SYCLGenSuccess();
if (CurrInst->is(asmtok::op_prefetch, asmtok::op_prefetchu) ||
CanSuppressCast(Dst->getSymbol()))
if (CurrInst->is(asmtok::op_prefetch) || CanSuppressCast(Dst->getSymbol()))
OS() << llvm::formatv("{0}", Reg);
else
OS() << llvm::formatv("(({0} *)(uintptr_t){1})", Type, Reg);
Expand Down Expand Up @@ -1289,9 +1288,7 @@ class SYCLGen : public SYCLGenBase {

AsmStateSpace SS = Inst->getStateSpace();
if (SS != AsmStateSpace::S_global && SS != AsmStateSpace::none) {
report(Diagnostics::API_NOT_MIGRATED, /*UseTextBegin=*/true,
GAS->getAsmString()->getString());
return SYCLGenSuccess();
return SYCLGenError();
}

if (!(Inst->hasAttr(InstAttr::L1) || Inst->hasAttr(InstAttr::L2)))
Expand All @@ -1310,17 +1307,15 @@ class SYCLGen : public SYCLGenBase {
evictionHint = "evict_normal";

if (!evictionHint.empty()) {
report(Diagnostics::API_NOT_MIGRATED, /*UseTextBegin=*/true,
GAS->getAsmString()->getString());
return SYCLGenSuccess();
return SYCLGenError();
}

llvm::SaveAndRestore<const InlineAsmInstruction *> Store(CurrInst);
CurrInst = Inst;
const auto *Src =
dyn_cast_or_null<InlineAsmAddressExpr>(Inst->getInputOperand(0));
if (!Src)
return false;
return SYCLGenError();

OS() << MapNames::getExpNamespace() << "prefetch(";
if (emitStmt(Src))
Expand All @@ -1333,15 +1328,6 @@ class SYCLGen : public SYCLGenBase {
return SYCLGenSuccess();
}

bool handle_prefetchu(const InlineAsmInstruction *Inst) override {
if (!DpctGlobalInfo::useExtPrefetch())
return SYCLGenError();

report(Diagnostics::API_NOT_MIGRATED, /*UseTextBegin=*/true,
GAS->getAsmString()->getString());
return SYCLGenSuccess();
}

StringRef GetWiderTypeAsString(const InlineAsmBuiltinType *Type) const {
switch (Type->getKind()) {
case InlineAsmBuiltinType::s16:
Expand Down
3 changes: 1 addition & 2 deletions clang/lib/DPCT/RulesAsm/Parser/AsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,7 @@ InlineAsmStmtResult InlineAsmParser::ParseInstruction() {
Out = nullptr;
}
// prefetch{.state}.{level} [%0] has only one input operand and no type.
if (Opcode->getTokenID() == asmtok::op_prefetch ||
Opcode->getTokenID() == asmtok::op_prefetchu) {
if (Opcode->getTokenID() == asmtok::op_prefetch) {
Ops.push_back(Out.get());
Out = nullptr;
Types.push_back(Context.getBuiltinType(InlineAsmBuiltinType::byte));
Expand Down
1 change: 0 additions & 1 deletion clang/lib/DPCT/SrcAPI/APINames_ASM.inc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ ENTRY("or", "or", true, NO_FLAG, P1, "Successful")
ENTRY("pmevent", "pmevent", false, NO_FLAG, P1, "Comment")
ENTRY("popc", "popc", true, NO_FLAG, P1, "Successful")
ENTRY("prefetch", "prefetch", true, NO_FLAG, P1, "Partial")
ENTRY("prefetchu", "prefetchu", true, NO_FLAG, P1, "Partial")
ENTRY("prmt", "prmt", false, NO_FLAG, P1, "Comment")
ENTRY("rcp", "rcp", true, NO_FLAG, P1, "Successful")
ENTRY("red", "red", false, NO_FLAG, P1, "Comment")
Expand Down
22 changes: 0 additions & 22 deletions clang/test/dpct/asm/prefetch.cu
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,6 @@ __global__ void prefetch(int *arr) {
/* using Register-Immediate (Displacement) address mode */
// CHECK: sycl::ext::oneapi::experimental::prefetch(((uint8_t *)((uintptr_t)arr + 2)), sycl::ext::oneapi::experimental::properties{sycl::ext::oneapi::experimental::prefetch_hint_L1});
asm volatile("prefetch.global.L1 [%0 + 2];" :: "l"(arr));

#ifndef BUILD_TEST
/* prefetch of global address space with eviction priority */
// CHECK: /*
// CHECK-NEXT: DPCT1007:{{.*}} Migration of prefetch.global.L2::evict_last [%0]; is not supported.
// CHECK-NEXT: */
asm volatile ("prefetch.global.L2::evict_last [%0];" : : "l"(arr));
// CHECK: /*
// CHECK-NEXT: DPCT1007:{{.*}} Migration of prefetch.global.L2::evict_normal [%0]; is not supported.
// CHECK-NEXT: */
asm volatile ("prefetch.global.L2::evict_normal [%0];" : : "l"(arr));

/* prefetch of local address space */
// CHECK: /*
// CHECK-NEXT: DPCT1007:{{.*}} Migration of prefetch.local.L1 [%0]; is not supported.
// CHECK-NEXT: */
asm volatile ("prefetch.local.L1 [%0];" : : "l"(arr));
// CHECK: /*
// CHECK-NEXT: DPCT1007:{{.*}} Migration of prefetch.local.L2 [%0]; is not supported.
// CHECK-NEXT: */
asm volatile ("prefetch.local.L2 [%0];" : : "l"(arr));
#endif // BUILD_TEST
}

// clang-format on
28 changes: 0 additions & 28 deletions clang/test/dpct/asm/prefetch_eviction_priority.cu

This file was deleted.

28 changes: 0 additions & 28 deletions clang/test/dpct/asm/prefetch_tensormap.cu

This file was deleted.

23 changes: 0 additions & 23 deletions clang/test/dpct/asm/prefetchu.cu

This file was deleted.

23 changes: 0 additions & 23 deletions clang/test/dpct/asm/prefetchu_default.cu

This file was deleted.

0 comments on commit 758c8fb

Please sign in to comment.