Skip to content

Conversation

@makslevental
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Dec 4, 2025

@llvm/pr-subscribers-mlir-execution-engine

Author: Maksim Levental (makslevental)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/170592.diff

1 Files Affected:

  • (modified) mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp (+7-3)
diff --git a/mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp b/mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp
index 2dbb993b1640f..ab53657577aec 100644
--- a/mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp
+++ b/mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp
@@ -38,12 +38,15 @@ mlirExecutionEngineCreate(MlirModule op, int optLevel, int numPaths,
 
   auto tmBuilderOrError = llvm::orc::JITTargetMachineBuilder::detectHost();
   if (!tmBuilderOrError) {
-    llvm::errs() << "Failed to create a JITTargetMachineBuilder for the host\n";
+    llvm::errs()
+        << "Failed to create a JITTargetMachineBuilder for the host because: "
+        << tmBuilderOrError.takeError() << "\n";
     return MlirExecutionEngine{nullptr};
   }
   auto tmOrError = tmBuilderOrError->createTargetMachine();
   if (!tmOrError) {
-    llvm::errs() << "Failed to create a TargetMachine for the host\n";
+    llvm::errs() << "Failed to create a TargetMachine for the host because: "
+                 << tmOrError.takeError() << "\n";
     return MlirExecutionEngine{nullptr};
   }
 
@@ -62,7 +65,8 @@ mlirExecutionEngineCreate(MlirModule op, int optLevel, int numPaths,
   jitOptions.enableObjectDump = enableObjectDump;
   auto jitOrError = ExecutionEngine::create(unwrap(op), jitOptions);
   if (!jitOrError) {
-    consumeError(jitOrError.takeError());
+    llvm::errs() << "Failed to create an ExecutionEngine because: "
+                 << jitOrError.takeError() << "\n";
     return MlirExecutionEngine{nullptr};
   }
   return wrap(jitOrError->release());

@llvmbot
Copy link
Member

llvmbot commented Dec 4, 2025

@llvm/pr-subscribers-mlir

Author: Maksim Levental (makslevental)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/170592.diff

1 Files Affected:

  • (modified) mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp (+7-3)
diff --git a/mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp b/mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp
index 2dbb993b1640f..ab53657577aec 100644
--- a/mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp
+++ b/mlir/lib/CAPI/ExecutionEngine/ExecutionEngine.cpp
@@ -38,12 +38,15 @@ mlirExecutionEngineCreate(MlirModule op, int optLevel, int numPaths,
 
   auto tmBuilderOrError = llvm::orc::JITTargetMachineBuilder::detectHost();
   if (!tmBuilderOrError) {
-    llvm::errs() << "Failed to create a JITTargetMachineBuilder for the host\n";
+    llvm::errs()
+        << "Failed to create a JITTargetMachineBuilder for the host because: "
+        << tmBuilderOrError.takeError() << "\n";
     return MlirExecutionEngine{nullptr};
   }
   auto tmOrError = tmBuilderOrError->createTargetMachine();
   if (!tmOrError) {
-    llvm::errs() << "Failed to create a TargetMachine for the host\n";
+    llvm::errs() << "Failed to create a TargetMachine for the host because: "
+                 << tmOrError.takeError() << "\n";
     return MlirExecutionEngine{nullptr};
   }
 
@@ -62,7 +65,8 @@ mlirExecutionEngineCreate(MlirModule op, int optLevel, int numPaths,
   jitOptions.enableObjectDump = enableObjectDump;
   auto jitOrError = ExecutionEngine::create(unwrap(op), jitOptions);
   if (!jitOrError) {
-    consumeError(jitOrError.takeError());
+    llvm::errs() << "Failed to create an ExecutionEngine because: "
+                 << jitOrError.takeError() << "\n";
     return MlirExecutionEngine{nullptr};
   }
   return wrap(jitOrError->release());

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

🐧 Linux x64 Test Results

  • 7179 tests passed
  • 596 tests skipped

✅ The build succeeded and all tests passed.

@makslevental makslevental force-pushed the users/makslevental/ee branch 2 times, most recently from a5209cd to a9aa267 Compare December 4, 2025 06:33
@makslevental makslevental force-pushed the users/makslevental/ee branch from a9aa267 to bf85bfc Compare December 4, 2025 06:35
Copy link
Member

@kuhar kuhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something we could have lit tests for?

@makslevental
Copy link
Contributor Author

makslevental commented Dec 4, 2025

Is this something we could have lit tests for?

Not lit but I can try adding Python tests (there's an existing Python test for the 3rd one)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's preexisting on the other codepath you're changing, but I'm surprised we diagnose errors unconditionally through llvm::errs() ; why is this done in these cases? Are there other APIs we do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure - before my time https://reviews.llvm.org/D102551

@makslevental
Copy link
Contributor Author

Is this something we could have lit tests for?

I failed to figure out a way to trigger each of the other fails (downstream I stumbled upon this by having an unconventional host/target triple relationship). Best I could do was add a lit check line for the current/existing test (which will function the same for the new reports).

@makslevental makslevental enabled auto-merge (squash) December 4, 2025 23:05
@makslevental makslevental merged commit 772ff04 into llvm:main Dec 4, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants