Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 sycl-jit/common/include/Kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ struct FrozenPropertyValue {
FrozenPropertyValue(std::string_view Name, uint32_t Value)
: Name{Name}, IsUIntValue{true}, UIntValue{Value}, Bytes{0} {}
FrozenPropertyValue(std::string_view Name, const uint8_t *Ptr, size_t Size)
: Name{Name}, IsUIntValue{false}, Bytes{Size} {
: Name{Name}, IsUIntValue{false}, UIntValue{0}, Bytes{Size} {
std::memcpy(Bytes.begin(), Ptr, Size);
}
};
Expand Down
2 changes: 2 additions & 0 deletions sycl-jit/jit-compiler/include/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class OptionStorage {
}

OptionStorage &operator=(OptionStorage &&Other) {
if (this == &Other)
return *this;
Storage = Other.Storage;
Other.Storage = nullptr;
return *this;
Expand Down
16 changes: 10 additions & 6 deletions sycl-jit/jit-compiler/lib/translation/KernelTranslation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,12 @@ KernelTranslator::loadKernels(llvm::LLVMContext &LLVMCtx,
// read last. This could cause problems if different modules contain
// definitions with the same name, but different body/content.
// Check that this is not problematic.
Linker::linkModules(*Result, std::move(NewMod),
Linker::Flags::OverrideFromSrc);
const bool HasErrors = Linker::linkModules(
*Result, std::move(NewMod), Linker::Flags::OverrideFromSrc);
if (HasErrors)
return createStringError(inconvertibleErrorCode(),
"Failed to link modules");

if (AddressBits != BinInfo.AddressBits) {
return createStringError(
inconvertibleErrorCode(),
Expand Down Expand Up @@ -300,9 +304,9 @@ KernelTranslator::translateToPTX(SYCLKernelInfo &KernelInfo, llvm::Module &Mod,
}

// FIXME: Check whether we can provide more accurate target information here
auto *TargetMachine = Target->createTargetMachine(
std::unique_ptr<TargetMachine> TargetMachine(Target->createTargetMachine(
TargetTriple, CPU, Features, {}, llvm::Reloc::PIC_, std::nullopt,
llvm::CodeGenOptLevel::Default);
llvm::CodeGenOptLevel::Default));

llvm::legacy::PassManager PM;

Expand Down Expand Up @@ -380,9 +384,9 @@ KernelTranslator::translateToAMDGCN(SYCLKernelInfo &KernelInfo,
}

// FIXME: Check whether we can provide more accurate target information here
auto *TargetMachine = Target->createTargetMachine(
std::unique_ptr<TargetMachine> TargetMachine(Target->createTargetMachine(
TargetTriple, CPU, Features, {}, llvm::Reloc::PIC_, std::nullopt,
llvm::CodeGenOptLevel::Default);
llvm::CodeGenOptLevel::Default));

std::string AMDObj;
{
Expand Down
1 change: 1 addition & 0 deletions sycl-jit/passes/target/TargetFusionInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ class NVPTXAMDGCNTargetFusionInfoBase : public TargetFusionInfoImpl {
SmallPtrSet<Constant *, 8> DeletedFuncs{Funcs.begin(), Funcs.end()};
SmallVector<MDNode *> ValidKernels;
auto *OldAnnotations = LLVMMod->getNamedMetadata(MDName);
assert(OldAnnotations && "Failed to retreive old annotations");
for (auto *Op : OldAnnotations->operands()) {
if (auto *TOp = dyn_cast<MDTuple>(Op)) {
if (auto *COp = dyn_cast_if_present<ConstantAsMetadata>(
Expand Down
Loading