Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildbot/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def do_configure(args, passthrough_args):
if not os.path.isdir(abs_obj_dir):
os.makedirs(abs_obj_dir)

llvm_external_projects = "sycl;llvm-spirv;opencl;xpti;xptifw;compiler-rt"
llvm_external_projects = "sycl;llvm-spirv;opencl;xpti;xptifw"

# libdevice build requires a working SYCL toolchain, which is not the case
# with macOS target right now.
Expand Down
3 changes: 0 additions & 3 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5480,9 +5480,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-fsycl-is-device");
CmdArgs.push_back("-fdeclare-spirv-builtins");

// Set the atomic profile update flag to increment counters atomically.
CmdArgs.push_back("-fprofile-update=atomic");

// Set O2 optimization level by default
if (!Args.getLastArg(options::OPT_O_Group))
CmdArgs.push_back("-O2");
Expand Down
6 changes: 5 additions & 1 deletion clang/lib/Driver/ToolChains/SYCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,11 @@ static ArrayRef<options::ID> getUnsupportedOpts() {
options::OPT_fno_profile_generate, // -f[no-]profile-generate
options::OPT_ftest_coverage,
options::OPT_fno_test_coverage, // -f[no-]test-coverage
options::OPT_coverage, // --coverage
options::OPT_fcoverage_mapping,
options::OPT_coverage, // --coverage
options::OPT_fno_coverage_mapping, // -f[no-]coverage-mapping
options::OPT_fprofile_instr_generate,
options::OPT_fprofile_instr_generate_EQ,
options::OPT_fprofile_arcs,
options::OPT_fno_profile_arcs, // -f[no-]profile-arcs
options::OPT_fno_profile_instr_generate, // -f[no-]profile-instr-generate
Expand Down
13 changes: 13 additions & 0 deletions clang/test/Driver/sycl-unsupported.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
// RUN: -DOPT_CC1=-debug-info-kind=line-tables-only \
// RUN: -check-prefixes=UNSUPPORTED_OPT_DIAG,UNSUPPORTED_OPT

// RUN: %clangxx -fsycl -fprofile-instr-generate -### %s 2>&1 \
// RUN: | FileCheck %s -DARCH=spir64 -DOPT=-fprofile-instr-generate \
// RUN: -DOPT_CC1=-fprofile-instrument=clang \
// RUN: -check-prefixes=UNSUPPORTED_OPT_DIAG,UNSUPPORTED_OPT
// RUN: %clangxx -fsycl -fcoverage-mapping \
// RUN: -fprofile-instr-generate -### %s 2>&1 \
// RUN: | FileCheck %s -DARCH=spir64 -DOPT=-fcoverage-mapping
// RUN: %clangxx -fsycl -ftest-coverage -### %s 2>&1 \
// RUN: | FileCheck %s -DARCH=spir64 -DOPT=-ftest-coverage \
// RUN: -DOPT_CC1=-coverage-notes-file \
Expand All @@ -42,6 +49,12 @@
// RUN: | FileCheck %s -DARCH=spir64 -DOPT=--coverage \
// RUN: -DOPT_CC1=-coverage-notes-file \
// RUN: -check-prefixes=UNSUPPORTED_OPT_DIAG,UNSUPPORTED_OPT
// Check to make sure our '-fsanitize=address' exception isn't triggered by a
// different option
// RUN: %clangxx -fsycl -fprofile-instr-generate=address -### %s 2>&1 \
// RUN: | FileCheck %s -DARCH=spir64 -DOPT=-fprofile-instr-generate=address \
// RUN: -DOPT_CC1=-fprofile-instrument=clang \
// RUN: -check-prefixes=UNSUPPORTED_OPT_DIAG,UNSUPPORTED_OPT

// CHECK: ignoring '[[OPT]]' option as it is not currently supported for target '[[ARCH]]{{.*}}'; only supported for host compilation [-Woption-ignored]
// CHECK-NOT: clang{{.*}} "-fsycl-is-device"{{.*}} "[[OPT]]{{.*}}"
Expand Down
16 changes: 0 additions & 16 deletions compiler-rt/lib/profile/InstrProfilingRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,6 @@ extern "C" {

#include "InstrProfiling.h"

void __sycl_increment_profile_counters(uint64_t FnHash, size_t NumCounters,
const uint64_t *Increments) {
for (const __llvm_profile_data *DataVar = __llvm_profile_begin_data();
DataVar < __llvm_profile_end_data(); DataVar++) {
if (DataVar->NameRef != FnHash || DataVar->NumCounters != NumCounters)
continue;

uint64_t *const Counters = reinterpret_cast<uint64_t *>(
reinterpret_cast<uintptr_t>(DataVar) +
reinterpret_cast<uintptr_t>(DataVar->CounterPtr));
for (size_t i = 0; i < NumCounters; i++)
Counters[i] += Increments[i];
break;
}
}

static int RegisterRuntime() {
__llvm_profile_initialize();
#ifdef _AIX
Expand Down
31 changes: 0 additions & 31 deletions llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,9 +1002,6 @@ bool InstrLowerer::lower() {
if (!NeedsRuntimeHook && ContainsProfiling)
emitRuntimeHook();

if (M.getTargetTriple().isSPIR())
return true;

emitRegistration();
emitUses();
emitInitialization();
Expand Down Expand Up @@ -1119,18 +1116,6 @@ GlobalVariable *InstrLowerer::getOrCreateBiasVar(StringRef VarName) {
}

Value *InstrLowerer::getCounterAddress(InstrProfCntrInstBase *I) {
if (M.getTargetTriple().isSPIR()) {
auto *Counters = getOrCreateRegionCounters(I);
IRBuilder<> Builder(I);
auto *Addr = Builder.CreateLoad(PointerType::get(M.getContext(), 1),
Counters, "pgocount.addr");
const std::uint64_t Index = I->getIndex()->getZExtValue();
if (Index == 0)
return Addr;
auto *Offset = Builder.getInt64(Index * sizeof(std::uint64_t));
return Builder.CreatePtrAdd(Addr, Offset, "pgocount.offset");
}

auto *Counters = getOrCreateRegionCounters(I);
IRBuilder<> Builder(I);

Expand Down Expand Up @@ -1672,22 +1657,6 @@ InstrLowerer::getOrCreateRegionBitmaps(InstrProfMCDCBitmapInstBase *Inc) {
GlobalVariable *
InstrLowerer::createRegionCounters(InstrProfCntrInstBase *Inc, StringRef Name,
GlobalValue::LinkageTypes Linkage) {
if (M.getTargetTriple().isSPIR()) {
uint64_t NumCounters = Inc->getNumCounters()->getZExtValue();
auto &Ctx = M.getContext();
auto *PtrTy = PointerType::get(Ctx, 1);
auto *IntTy = Type::getInt64Ty(Ctx);
auto *StructTy = StructType::get(Ctx, {PtrTy, IntTy});
GlobalVariable *GV = new GlobalVariable(
M, StructTy, false, Linkage, Constant::getNullValue(StructTy), Name);
const std::uint64_t FnHash = IndexedInstrProf::ComputeHash(
getPGOFuncNameVarInitializer(Inc->getName()));
const std::string FnName = std::string{"__profc_"} + std::to_string(FnHash);
GV->addAttribute("sycl-unique-id", FnName);
GV->addAttribute("sycl-device-global-size", Twine(NumCounters * 8).str());
return GV;
}

uint64_t NumCounters = Inc->getNumCounters()->getZExtValue();
auto &Ctx = M.getContext();
GlobalVariable *GV;
Expand Down
29 changes: 0 additions & 29 deletions llvm/test/Instrumentation/InstrProfiling/coverage_sycl.ll

This file was deleted.

3 changes: 0 additions & 3 deletions sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -389,16 +389,13 @@ add_custom_target(sycl-compiler
clang-offload-extract
clang-offload-packager
clang-linker-wrapper
compiler-rt
file-table-tform
llc
llvm-ar
llvm-foreach
llvm-spirv
llvm-link
llvm-objcopy
llvm-profdata
llvm-cov
spirv-to-ir-wrapper
sycl-post-link
opencl-aot
Expand Down
71 changes: 0 additions & 71 deletions sycl/doc/design/DeviceCodeCoverage.md

This file was deleted.

1 change: 0 additions & 1 deletion sycl/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Design Documents for the oneAPI DPC++ Compiler
design/ParallelForRangeRounding
design/SYCLInstrumentationUsingXPTI
design/ITTAnnotations
design/DeviceCodeCoverage
design/DeviceGlobal
design/CompileTimeProperties
design/HostPipes
Expand Down
5 changes: 0 additions & 5 deletions sycl/source/detail/context_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ context_impl::~context_impl() {
if (DGEntry != nullptr)
DGEntry->removeAssociatedResources(this);
}
// Free all profile counter USM allocations associated with this context.
for (DeviceGlobalMapEntry *DGEntry :
detail::ProgramManager::getInstance()
.getProfileCounterDeviceGlobalEntries(this))
DGEntry->cleanupProfileCounter(this);
MCachedLibPrograms.clear();
// TODO catch an exception and put it to list of asynchronous exceptions
getAdapter().call_nocheck<UrApiKind::urContextRelease>(MContext);
Expand Down
15 changes: 1 addition & 14 deletions sycl/source/detail/device_global_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ class DeviceGlobalMap {
// cannot be set until registration happens.
auto EntryUPtr = std::make_unique<DeviceGlobalMapEntry>(
DeviceGlobal->Name, Img, TypeSize, DeviceImageScopeDecorated);
auto NewEntry =
MDeviceGlobals.emplace(DeviceGlobal->Name, std::move(EntryUPtr));
if (NewEntry.first->second->isProfileCounter())
MProfileCounterDeviceGlobals.push_back(NewEntry.first->second.get());
MDeviceGlobals.emplace(DeviceGlobal->Name, std::move(EntryUPtr));
}
}
}
Expand Down Expand Up @@ -117,8 +114,6 @@ class DeviceGlobalMap {
auto EntryUPtr =
std::make_unique<DeviceGlobalMapEntry>(UniqueId, DeviceGlobalPtr);
auto NewEntry = MDeviceGlobals.emplace(UniqueId, std::move(EntryUPtr));
if (NewEntry.first->second->isProfileCounter())
MProfileCounterDeviceGlobals.push_back(NewEntry.first->second.get());
MPtr2DeviceGlobal.insert({DeviceGlobalPtr, NewEntry.first->second.get()});
}

Expand Down Expand Up @@ -159,11 +154,6 @@ class DeviceGlobalMap {
}
}

std::vector<DeviceGlobalMapEntry *> getProfileCounterEntries() {
std::lock_guard<std::mutex> DeviceGlobalsGuard(MDeviceGlobalsMutex);
return MProfileCounterDeviceGlobals;
}

const std::unordered_map<const void *, DeviceGlobalMapEntry *>
getPointerMap() const {
return MPtr2DeviceGlobal;
Expand All @@ -187,9 +177,6 @@ class DeviceGlobalMap {
MDeviceGlobals;
std::unordered_map<const void *, DeviceGlobalMapEntry *> MPtr2DeviceGlobal;

// List of profile counter device globals.
std::vector<DeviceGlobalMapEntry *> MProfileCounterDeviceGlobals;

/// Protects MDeviceGlobals and MPtr2DeviceGlobal.
std::mutex MDeviceGlobalsMutex;
};
Expand Down
Loading
Loading