Copilot commented on code in PR #51266:
URL: https://github.com/apache/arrow/pull/51266#discussion_r3970297356


##########
cpp/src/gandiva/engine.cc:
##########
@@ -439,7 +462,10 @@ Status Engine::LoadExternalPreCompiledIR() {
   for (const auto& buffer : buffers) {
     auto llvm_memory_buffer_ref = AsLLVMMemoryBuffer(*buffer);
     auto module_or_error = llvm::parseBitcodeFile(llvm_memory_buffer_ref, 
*context());
-    ARROW_RETURN_NOT_OK(VerifyAndLinkModule(*module_, 
std::move(module_or_error)));
+    ARROW_ASSIGN_OR_RAISE(
+        auto src_ir_module,
+        AsArrowResult(module_or_error, "Failed to verify and link module: "));
+    ARROW_RETURN_NOT_OK(VerifyAndLinkModule(*module_, 
std::move(src_ir_module)));

Review Comment:
   `LoadExternalPreCompiledIR` strips build target attributes for the built-in 
bitcode, but not for bitcode buffers coming from `FunctionRegistry`. With LLVM 
23’s stricter target-feature compatibility checks, external precompiled bitcode 
can hit the same mismatch/inlining failures; apply 
`RemoveBuildTargetAttributes` before linking these modules as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to