https://github.com/joker-eph updated https://github.com/llvm/llvm-project/pull/71165
>From 183f5094ff7da09beed46f760a857af449a24245 Mon Sep 17 00:00:00 2001 From: Mehdi Amini <mam...@nvidia.com> Date: Fri, 3 Nov 2023 13:26:56 -0700 Subject: [PATCH] use cached TM Created using spr 1.3.4 --- mlir/lib/Target/LLVM/ModuleToObject.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mlir/lib/Target/LLVM/ModuleToObject.cpp b/mlir/lib/Target/LLVM/ModuleToObject.cpp index 6af3d49ab23bf74..d94c10de8d7c424 100644 --- a/mlir/lib/Target/LLVM/ModuleToObject.cpp +++ b/mlir/lib/Target/LLVM/ModuleToObject.cpp @@ -45,8 +45,10 @@ Operation &ModuleToObject::getOperation() { return module; } std::optional<llvm::TargetMachine *> ModuleToObject::getOrCreateTargetMachine() { - std::string error; + if (targetMachine) + return targetMachine.get(); // Load the target. + std::string error; const llvm::Target *target = llvm::TargetRegistry::lookupTarget(triple, error); if (!target) { _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits