impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Ho (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-6177: Cleanup incomplete handcrafted IRs before finalizing module
Date Fri, 15 Dec 2017 01:11:54 GMT
Michael Ho has posted comments on this change. ( )

Change subject: IMPALA-6177: Cleanup incomplete handcrafted IRs before finalizing module

Patch Set 10:


Looking good. Just some more minor comments. Please add a test case and I can +2 it afterwards.
Commit Message:
PS10, Line 12: (method body is truncated)
deleted from module ?
File be/src/codegen/
PS8, Line 167: }
> We could use the magic IMPALA_ASSERT_DEBUG_DEATH() macro if we want to test
Yes, that's a legitimate use case. Can you please add a test case in which we don't call FinalizeFunction()
but don't reference it either. This is to exercise the path which deletes functions which
aren't finalized.
File be/src/codegen/llvm-codegen.h:
PS10, Line 374: removed
deleted from the module
PS10, Line 374: their function body
the functions
File be/src/codegen/
PS10, Line 658: DCHECK(
nit: DCHECK_EQ()
PS10, Line 771: codegen_->handcrafted_functions_.push_back(fn);
Mind adding a comment on why we only add function to "handcrafted_functions_" only when builder
!= NULL ? It's probably related to the fact that we don't insert the basic block "entry" if
we builder == nullptr ?
PS10, Line 1059: deleting the function's body.
Is this still true ?
PS10, Line 1062:       fn->eraseFromParent();
I assume this should not happen very often so is it worth logging to aid debugging ?

It's a bit unfortunate that we cannot add DCHECK(fn->user_empty()) here as the module hasn't
been materialized yet. Please consider adding a comment stating that any reference to this
function will lead to crash in LLVM (and thus Impala).

To view, visit
To unsubscribe, visit

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If975cfb3906482b36dd6ede32ca81de6fcee1d7f
Gerrit-Change-Number: 8541
Gerrit-PatchSet: 10
Gerrit-Owner: Bikramjeet Vig <>
Gerrit-Reviewer: Bikramjeet Vig <>
Gerrit-Reviewer: Michael Ho <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-Comment-Date: Fri, 15 Dec 2017 01:11:54 +0000
Gerrit-HasComments: Yes

  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message