Skip to content

Commit 6daf59e

Browse files
authored
Updating LLVM in order to pull in the following change: - llvm/llvm-project#128566 For context, crash reproduction generation in MLIR will run the `PassManager`'s passes in a child thread. The above PR fixes crashes for when passes such as `add_di_scope` add `DistinctAttr` to the IR and their storage is then accessed later once the child thread joins. Pulling this in improves QoL for out-of-tree projects and makes the pass manager more robust to the use of `DistinctAttr`. This pin update has also introduced the deprecation of a `llvm::TargetMachine::createTargetMachine` overload. I've updated the callsites to use the non-deprecated overloads. # New contributor declaration - [x] I am not making a trivial change, such as fixing a typo in a comment. - [x] I have written a PR description following these [rules](https://cbea.ms/git-commit/#why-not-how). - [x] I have run `pre-commit run --from-ref origin/main --to-ref HEAD`. - Select one of the following. - [ ] I have added tests. - `/test` for `lit` tests - `/unittest` for C++ tests - `/python/test` for end-to-end tests - [x] This PR does not need a test because `this PR only updates the LLVM pin, so CI is sufficient`. - Select one of the following. - [x] I have not added any `lit` tests. - [ ] The `lit` tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices), including the "tests should be minimal" section. (Usually running Python code and using the instructions it generates is not minimal.)
1 parent a92b0b5 commit 6daf59e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cmake/llvm-hash.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2619c2ed584cdf3b38e6743ed3c785223f06e3f7
1+
0aa5ba43a0d11ce8e7f143380ae75fea516b6841

python/src/llvm.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ createTargetMachine(llvm::Module *module, std::string proc,
5959
opt.MCOptions.AsmVerbose = true;
6060
opt.MCOptions.PreserveAsmComments = true;
6161
std::unique_ptr<llvm::TargetMachine> machine{target->createTargetMachine(
62-
module->getTargetTriple(), proc, features, opt, llvm::Reloc::PIC_,
62+
module->getTargetTriple().str(), proc, features, opt, llvm::Reloc::PIC_,
6363
std::nullopt,
6464
disableLLVMOpt ? llvm::CodeGenOptLevel::None
6565
: llvm::CodeGenOptLevel::Aggressive)};
@@ -132,7 +132,7 @@ std::string translateLLVMIRToASM(llvm::Module &module,
132132
// module->print(llvm::outs(), nullptr);
133133

134134
// create machine
135-
module.setTargetTriple(triple);
135+
module.setTargetTriple(Triple(triple));
136136
auto machine = createTargetMachine(&module, proc, enable_fp_fusion, features);
137137
// set data layout
138138
module.setDataLayout(machine->createDataLayout());
@@ -277,8 +277,8 @@ void init_triton_llvm(py::module &&m) {
277277
llvm::TargetOptions opt;
278278
// Target machine is only used to create the data layout.
279279
std::unique_ptr<llvm::TargetMachine> machine{target->createTargetMachine(
280-
triple, proc, features, opt, llvm::Reloc::PIC_, std::nullopt,
281-
llvm::CodeGenOptLevel::None)};
280+
llvm::Triple(triple), proc, features, opt, llvm::Reloc::PIC_,
281+
std::nullopt, llvm::CodeGenOptLevel::None)};
282282
// set data layout
283283
mod->setDataLayout(machine->createDataLayout());
284284
});

0 commit comments

Comments
 (0)