Skip to content

Commit d6a7091

Browse files
authored
Merge branch 'main' into users/rampitec/08-13-_amdgpu_add_hw_reg_ib_sts2_on_gfx1250
2 parents d2854ea + bfd490e commit d6a7091

File tree

12 files changed

+23
-146
lines changed

12 files changed

+23
-146
lines changed

.github/workflows/containers/github-action-ci-windows/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ RUN powershell -Command \
9090
RUN git config --system core.longpaths true & \
9191
git config --global core.autocrlf false
9292
93-
ARG RUNNER_VERSION=2.327.1
93+
ARG RUNNER_VERSION=2.328.0
9494
ENV RUNNER_VERSION=$RUNNER_VERSION
9595
9696
RUN powershell -Command \

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ WORKDIR /home/gha
9797

9898
FROM ci-container as ci-container-agent
9999

100-
ENV GITHUB_RUNNER_VERSION=2.327.1
100+
ENV GITHUB_RUNNER_VERSION=2.328.0
101101

102102
RUN mkdir actions-runner && \
103103
cd actions-runner && \

libcxx/utils/ci/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ services:
2323
dockerfile: Dockerfile
2424
target: actions-builder
2525
args:
26-
GITHUB_RUNNER_VERSION: "2.327.1"
26+
GITHUB_RUNNER_VERSION: "2.328.0"
2727
<<: [*image_versions, *compiler_versions]
2828

2929
android-buildkite-builder:

llvm/lib/Support/MemoryBuffer.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,14 @@ getOpenFileImpl(sys::fs::file_t FD, const Twine &Filename, uint64_t FileSize,
501501
std::unique_ptr<MB> Result(
502502
new (NamedBufferAlloc(Filename)) MemoryBufferMMapFile<MB>(
503503
RequiresNullTerminator, FD, MapSize, Offset, EC));
504-
if (!EC)
505-
return std::move(Result);
504+
if (!EC) {
505+
// On at least Linux, and possibly on other systems, mmap may return pages
506+
// from the page cache that are not properly filled with trailing zeroes,
507+
// if some prior user of the page wrote non-zero bytes. Detect this and
508+
// don't use mmap in that case.
509+
if (!RequiresNullTerminator || *Result->getBufferEnd() == '\0')
510+
return std::move(Result);
511+
}
506512
}
507513

508514
#ifdef __MVS__

mlir/include/mlir-c/ExecutionEngine.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ MLIR_CAPI_EXPORTED MlirExecutionEngine mlirExecutionEngineCreate(
4646
MlirModule op, int optLevel, int numPaths,
4747
const MlirStringRef *sharedLibPaths, bool enableObjectDump);
4848

49-
/// Initialize the ExecutionEngine. Global constructors specified by
50-
/// `llvm.mlir.global_ctors` will be run. One common scenario is that kernel
51-
/// binary compiled from `gpu.module` gets loaded during initialization. Make
52-
/// sure all symbols are resolvable before initialization by calling
53-
/// `mlirExecutionEngineRegisterSymbol` or including shared libraries.
54-
MLIR_CAPI_EXPORTED void mlirExecutionEngineInitialize(MlirExecutionEngine jit);
55-
5649
/// Destroy an ExecutionEngine instance.
5750
MLIR_CAPI_EXPORTED void mlirExecutionEngineDestroy(MlirExecutionEngine jit);
5851

mlir/include/mlir/ExecutionEngine/ExecutionEngine.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,6 @@ class ExecutionEngine {
227227
llvm::function_ref<llvm::orc::SymbolMap(llvm::orc::MangleAndInterner)>
228228
symbolMap);
229229

230-
/// Initialize the ExecutionEngine. Global constructors specified by
231-
/// `llvm.mlir.global_ctors` will be run. One common scenario is that kernel
232-
/// binary compiled from `gpu.module` gets loaded during initialization. Make
233-
/// sure all symbols are resolvable before initialization by calling
234-
/// `registerSymbols` or including shared libraries.
235-
void initialize();
236-
237230
private:
238231
/// Ordering of llvmContext and jit is important for destruction purposes: the
239232
/// jit must be destroyed before the context.
@@ -257,8 +250,6 @@ class ExecutionEngine {
257250
/// Destroy functions in the libraries loaded by the ExecutionEngine that are
258251
/// called when this ExecutionEngine is destructed.
259252
SmallVector<LibraryDestroyFn> destroyFns;
260-
261-
bool isInitialized = false;
262253
};
263254

264255
} // namespace mlir

mlir/lib/Bindings/Python/ExecutionEngineModule.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "mlir-c/ExecutionEngine.h"
10-
#include "mlir/Bindings/Python/Nanobind.h"
1110
#include "mlir/Bindings/Python/NanobindAdaptors.h"
11+
#include "mlir/Bindings/Python/Nanobind.h"
1212

1313
namespace nb = nanobind;
1414
using namespace mlir;
@@ -124,17 +124,6 @@ NB_MODULE(_mlirExecutionEngine, m) {
124124
},
125125
nb::arg("name"), nb::arg("callback"),
126126
"Register `callback` as the runtime symbol `name`.")
127-
.def(
128-
"initialize",
129-
[](PyExecutionEngine &executionEngine) {
130-
mlirExecutionEngineInitialize(executionEngine.get());
131-
},
132-
"Initialize the ExecutionEngine. Global constructors specified by "
133-
"`llvm.mlir.global_ctors` will be run. One common scenario is that "
134-
"kernel binary compiled from `gpu.module` gets loaded during "
135-
"initialization. Make sure all symbols are resolvable before "
136-
"initialization by calling `raw_register_runtime` or including "
137-
"shared libraries.")
138127
.def(
139128
"dump_to_object_file",
140129
[](PyExecutionEngine &executionEngine, const std::string &fileName) {

mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@ mlirExecutionEngineCreate(MlirModule op, int optLevel, int numPaths,
6868
return wrap(jitOrError->release());
6969
}
7070

71-
extern "C" void mlirExecutionEngineInitialize(MlirExecutionEngine jit) {
72-
unwrap(jit)->initialize();
73-
}
74-
7571
extern "C" void mlirExecutionEngineDestroy(MlirExecutionEngine jit) {
7672
delete (unwrap(jit));
7773
}
@@ -110,8 +106,9 @@ extern "C" void mlirExecutionEngineRegisterSymbol(MlirExecutionEngine jit,
110106
void *sym) {
111107
unwrap(jit)->registerSymbols([&](llvm::orc::MangleAndInterner interner) {
112108
llvm::orc::SymbolMap symbolMap;
113-
symbolMap[interner(unwrap(name))] = {llvm::orc::ExecutorAddr::fromPtr(sym),
114-
llvm::JITSymbolFlags::Exported};
109+
symbolMap[interner(unwrap(name))] =
110+
{ llvm::orc::ExecutorAddr::fromPtr(sym),
111+
llvm::JITSymbolFlags::Exported };
115112
return symbolMap;
116113
});
117114
}

mlir/lib/ExecutionEngine/ExecutionEngine.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void ExecutionEngine::dumpToObjectFile(StringRef filename) {
106106
}
107107
// Compilation is lazy and it doesn't populate object cache unless requested.
108108
// In case object dump is requested before cache is populated, we need to
109-
// force compilation manually.
109+
// force compilation manually.
110110
if (cache->isEmpty()) {
111111
for (std::string &functionName : functionNames) {
112112
auto result = lookupPacked(functionName);
@@ -400,6 +400,13 @@ ExecutionEngine::create(Operation *m, const ExecutionEngineOptions &options,
400400
return symbolMap;
401401
};
402402
engine->registerSymbols(runtimeSymbolMap);
403+
404+
// Execute the global constructors from the module being processed.
405+
// TODO: Allow JIT initialize for AArch64. Currently there's a bug causing a
406+
// crash for AArch64 see related issue #71963.
407+
if (!engine->jit->getTargetTriple().isAArch64())
408+
cantFail(engine->jit->initialize(engine->jit->getMainJITDylib()));
409+
403410
return std::move(engine);
404411
}
405412

@@ -435,7 +442,6 @@ Expected<void *> ExecutionEngine::lookup(StringRef name) const {
435442

436443
Error ExecutionEngine::invokePacked(StringRef name,
437444
MutableArrayRef<void *> args) {
438-
initialize();
439445
auto expectedFPtr = lookupPacked(name);
440446
if (!expectedFPtr)
441447
return expectedFPtr.takeError();
@@ -445,13 +451,3 @@ Error ExecutionEngine::invokePacked(StringRef name,
445451

446452
return Error::success();
447453
}
448-
449-
void ExecutionEngine::initialize() {
450-
if (isInitialized)
451-
return;
452-
// TODO: Allow JIT initialize for AArch64. Currently there's a bug causing a
453-
// crash for AArch64 see related issue #71963.
454-
if (!jit->getTargetTriple().isAArch64())
455-
cantFail(jit->initialize(jit->getMainJITDylib()));
456-
isInitialized = true;
457-
}

mlir/lib/ExecutionEngine/JitRunner.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ compileAndExecute(Options &options, Operation *module, StringRef entryPoint,
202202

203203
auto engine = std::move(*expectedEngine);
204204

205-
engine->initialize();
206-
207205
auto expectedFPtr = engine->lookupPacked(entryPoint);
208206
if (!expectedFPtr)
209207
return expectedFPtr.takeError();

0 commit comments

Comments
 (0)