Bikramjeet Vig 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 8: (10 comments) 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: } > Can you please also add a test case in which we don't finalize a handcrafte that would crash llvm(and hence the process) during FinalizeModule http://gerrit.cloudera.org:8080/#/c/8541/8/be/src/codegen/llvm-codegen-test.cc@327 PS8, Line 327: EXPECT_TRUE(VerifyFunction(codegen.get(), string_test_fn)); > Does this become unnecessary given you called FinalizeFunction() in Codegen yes, removed http://gerrit.cloudera.org:8080/#/c/8541/8/be/src/codegen/llvm-codegen-test.cc@330 PS8, Line 330: void* jitted_fn = NULL; : AddFunctionToJit(codegen.get(), string_test_fn, &jitted_fn); > Same here. This is necessary as we need to explicitly add it to the list of JIT functions as FinalizeFunction does not do that http://gerrit.cloudera.org:8080/#/c/8541/8/be/src/codegen/llvm-codegen.h File be/src/codegen/llvm-codegen.h: http://gerrit.cloudera.org:8080/#/c/8541/8/be/src/codegen/llvm-codegen.h@107 PS8, Line 107: build > nit: built Done http://gerrit.cloudera.org:8080/#/c/8541/8/be/src/codegen/llvm-codegen.h@109 PS8, Line 109: Loaded > Cross-compiled Done http://gerrit.cloudera.org:8080/#/c/8541/8/be/src/codegen/llvm-codegen.h@219 PS8, Line 219: should > must Done http://gerrit.cloudera.org:8080/#/c/8541/8/be/src/codegen/llvm-codegen.h@363 PS8, Line 363: /// FinalizeFunction() on the returned function as it is already materialized. > I find this last statement potentially confusing. Most of the time, we call Done http://gerrit.cloudera.org:8080/#/c/8541/8/be/src/codegen/llvm-codegen.h@385 PS8, Line 385: /// this method. > Shouldn't there be a DCHECK in this function to enforce this ? Done http://gerrit.cloudera.org:8080/#/c/8541/8/be/src/codegen/llvm-codegen.h@765 PS8, Line 765: generated > generated from scratch Done http://gerrit.cloudera.org:8080/#/c/8541/8/be/src/codegen/llvm-codegen.cc File be/src/codegen/llvm-codegen.cc: http://gerrit.cloudera.org:8080/#/c/8541/8/be/src/codegen/llvm-codegen.cc@1062 PS8, Line 1062: deleteBody() > Why not fn->eraseFromParent() ? switching to fn->eraseFromParent(). If we remove the unfinalized IR function altogether from the module but still use it to replace some call sites in a loaded cross-compiled function, the compilation would crash impalad. I dont currently see anywhere in the codebase where we would use a handcrafted IR even if finalize function fails. So, switching to fn->eraseFromParent() would work. Also, I ll run core tests again with this patch using llvm 5 after I get a +2 but before I run the GVO merge job. -- 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: 8 Gerrit-Owner: Bikramjeet Vig <[email protected]> Gerrit-Reviewer: Bikramjeet Vig <[email protected]> Gerrit-Reviewer: Michael Ho <[email protected]> Gerrit-Reviewer: Tim Armstrong <[email protected]> Gerrit-Comment-Date: Tue, 12 Dec 2017 23:55:43 +0000 Gerrit-HasComments: Yes
