[OpenMP][Offload] Revert format of changed messages (#171995)

Adjust format of some of the updated debug output to match the old
format as there are a number of tests that rely on it.
This commit is contained in:
Alex Duran 2025-12-16 18:31:05 +01:00 committed by GitHub
parent eaf6d9a2ff
commit 8dd75fa473
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 7 deletions

View File

@ -44,6 +44,7 @@
#include <string>
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/circular_raw_ostream.h"
/// 32-Bit field data attributes controlling information presented to the user.
@ -578,6 +579,12 @@ static inline odbg_ostream reportErrorStream() {
} \
} while (false)
// Define default format for pointers
static inline raw_ostream &operator<<(raw_ostream &Os, void *Ptr) {
Os << ::llvm::format(DPxMOD, DPxPTR(Ptr));
return Os;
}
#else
#define DP(...) \
{ \

View File

@ -25,7 +25,6 @@
#include "Utils/ExponentialBackoff.h"
#include "llvm/Frontend/OpenMP/OMPConstants.h"
#include "llvm/Support/Format.h"
#include <cassert>
#include <cstdint>
@ -138,9 +137,9 @@ targetData(ident_t *Loc, int64_t DeviceId, int32_t ArgNum, void **ArgsBase,
RegionTypeMsg);
ODBG_OS(ODT_Kernel, [&](llvm::raw_ostream &Os) {
for (int I = 0; I < ArgNum; ++I) {
Os << "Entry " << llvm::format_decimal(I, 2) << ": Base=" << ArgsBase[I]
Os << "Entry " << llvm::format("%2d", I) << ": Base=" << ArgsBase[I]
<< ", Begin=" << Args[I] << ", Size=" << ArgSizes[I]
<< ", Type=" << llvm::format_hex(ArgTypes[I], 8) << ", Name="
<< ", Type=" << llvm::format("0x%" PRIx64, ArgTypes[I]) << ", Name="
<< ((ArgNames) ? getNameFromMapping(ArgNames[I]) : "unknown") << "\n";
}
});
@ -358,11 +357,11 @@ static inline int targetKernel(ident_t *Loc, int64_t DeviceId, int32_t NumTeams,
ODBG_OS(ODT_Kernel, [&](llvm::raw_ostream &Os) {
for (uint32_t I = 0; I < KernelArgs->NumArgs; ++I) {
Os << "Entry " << llvm::format_decimal(I, 2)
Os << "Entry" << llvm::format("%2d", I)
<< ": Base=" << KernelArgs->ArgBasePtrs[I]
<< ", Begin=" << KernelArgs->ArgPtrs[I]
<< ", Size=" << KernelArgs->ArgSizes[I]
<< ", Type=" << llvm::format_hex(KernelArgs->ArgTypes[I], 8)
<< ", Type=" << llvm::format("0x%" PRIx64, KernelArgs->ArgTypes[I])
<< ", Name="
<< (KernelArgs->ArgNames
? getNameFromMapping(KernelArgs->ArgNames[I]).c_str()
@ -508,7 +507,8 @@ EXTERN void __tgt_push_mapper_component(void *RtMapperHandle, void *Base,
ODBG(ODT_Interface) << "__tgt_push_mapper_component(Handle=" << RtMapperHandle
<< ") adds an entry (Base=" << Base << ", Begin=" << Begin
<< ", Size=" << Size
<< ", Type=" << llvm::format_hex(Type, 8) << ", Name="
<< ", Type=" << llvm::format("0x%" PRIx64, Type)
<< ", Name="
<< ((Name) ? getNameFromMapping(Name) : "unknown") << ")";
auto *MapperComponentsPtr = (struct MapperComponentsTy *)RtMapperHandle;
MapperComponentsPtr->Components.push_back(

View File

@ -1311,7 +1311,7 @@ static int targetDataNonContiguous(ident_t *Loc, DeviceTy &Device,
}
}
} else {
char *Ptr = (char *)ArgsBase + Offset;
void *Ptr = reinterpret_cast<void *>((char *)ArgsBase + Offset);
ODBG(ODT_Mapping) << "Transfer of non-contiguous : host ptr " << Ptr
<< " offset " << Offset << " len " << Size;
Ret = targetDataContiguous(Loc, Device, ArgsBase, Ptr, Size, ArgType,