Michael Ho has posted comments on this change. ( http://gerrit.cloudera.org:8080/8541 )
Change subject: IMPALA-6177: Cleanup incomplete handcrafted IRs before finalizing module ...................................................................... Patch Set 10: (8 comments) Looking good. Just some more minor comments. Please add a test case and I can +2 it afterwards. http://gerrit.cloudera.org:8080/#/c/8541/10//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/8541/10//COMMIT_MSG@12 PS10, Line 12: (method body is truncated) deleted from module ? http://gerrit.cloudera.org:8080/#/c/8541/8/be/src/codegen/llvm-codegen-test.cc File be/src/codegen/llvm-codegen-test.cc: http://gerrit.cloudera.org:8080/#/c/8541/8/be/src/codegen/llvm-codegen-test.cc@167 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. http://gerrit.cloudera.org:8080/#/c/8541/10/be/src/codegen/llvm-codegen.h File be/src/codegen/llvm-codegen.h: http://gerrit.cloudera.org:8080/#/c/8541/10/be/src/codegen/llvm-codegen.h@374 PS10, Line 374: removed deleted from the module http://gerrit.cloudera.org:8080/#/c/8541/10/be/src/codegen/llvm-codegen.h@374 PS10, Line 374: their function body the functions http://gerrit.cloudera.org:8080/#/c/8541/10/be/src/codegen/llvm-codegen.cc File be/src/codegen/llvm-codegen.cc: http://gerrit.cloudera.org:8080/#/c/8541/10/be/src/codegen/llvm-codegen.cc@658 PS10, Line 658: DCHECK( nit: DCHECK_EQ() http://gerrit.cloudera.org:8080/#/c/8541/10/be/src/codegen/llvm-codegen.cc@771 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 ? http://gerrit.cloudera.org:8080/#/c/8541/10/be/src/codegen/llvm-codegen.cc@1059 PS10, Line 1059: deleting the function's body. Is this still true ? http://gerrit.cloudera.org:8080/#/c/8541/10/be/src/codegen/llvm-codegen.cc@1062 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 http://gerrit.cloudera.org:8080/8541 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings 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 <bikramjeet....@cloudera.com> Gerrit-Reviewer: Bikramjeet Vig <bikramjeet....@cloudera.com> Gerrit-Reviewer: Michael Ho <k...@cloudera.com> Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com> Gerrit-Comment-Date: Fri, 15 Dec 2017 01:11:54 +0000 Gerrit-HasComments: Yes