impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Ho (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4595: Ignore discarded functions after linking
Date Tue, 06 Dec 2016 20:42:00 GMT
Michael Ho has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/5384

Change subject: IMPALA-4595: Ignore discarded functions after linking
......................................................................

IMPALA-4595: Ignore discarded functions after linking

For LLVM IR UDF, Impalad will link an external LLVM module
in which the IR UDF is defined with the main module. If it
happens that a symbol is defined in both modules, LLVM may
choose to discard the one defined in the external module.
The discarded function and its callee will not be present
in the linked module.

In IMPALA-4595, udf-sample.cc was compiled without any
optimization. Duplicated definition such as StringVal::null()
may have different inlining level between the external module
and the main module. When the duplicated definition in
the external module is discarded, some of its callee
functions (which are not inlined) may not be defined in the
main module so they can no longer be located in the linked
module. This trips up some code in the LlvmCodegen::LinkModule().
In particular, when parsing for functions in external module
which are materialized during linking, certain functions may
not be present due to the reason above. Impalad will hit
a DCHECK in debug build or crash due to null pointer access
in release build.

This change fixes the problem above by taking into account
that certain functions may not be defined anymore after linking.
This change also fixes two incorrect status propagation in
fe-support.cc.

Change-Id: Iaa056a0c888bfcc95b412e1bc1063bb607b58ab7
---
M be/src/codegen/llvm-codegen.cc
M be/src/service/fe-support.cc
M be/src/testutil/test-udfs.cc
3 files changed, 13 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/84/5384/1
-- 
To view, visit http://gerrit.cloudera.org:8080/5384
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa056a0c888bfcc95b412e1bc1063bb607b58ab7
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Michael Ho <kwho@cloudera.com>

Mime
View raw message