Yida Wu has posted comments on this change. ( http://gerrit.cloudera.org:8080/20733 )
Change subject: IMPALA-11805: Use llvm ObjectCache for codegen caching ...................................................................... Patch Set 3: (12 comments) Thanks Michael for the review. http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-codegen-cache-test.cc File be/src/codegen/llvm-codegen-cache-test.cc: http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-codegen-cache-test.cc@298 PS2, Line 298: // 172B for optimal mode, or 180B on ARM systems > I experimented with this. In practice I saw minimal (<= 8B) difference betw Adjusted the value after adding sizeof(CodeGenObjectCache). http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-codegen-cache.h File be/src/codegen/llvm-codegen-cache.h: http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-codegen-cache.h@308 PS2, Line 308: std::unordered_map<const CodeGenObjectCache*, std::shared_ptr<CodeGenObjectCache>> > This would also work as a std::unordered_set. https://en.cppreference.com/w When creating a temporary shared_ptr from the raw pointer, there might be a double-free problem. I'm uncertain if there's a more optimal solution. However, considering the cache entry is typically over 1k bytes while the 8-byte pointer is relatively small, it doesn't seem like a significant concern in this context. http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-codegen.h File be/src/codegen/llvm-codegen.h: http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-codegen.h@33 PS2, Line 33: #include <llvm/IR/DerivedTypes.h> > What's this used for? Done http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-codegen.h@353 PS2, Line 353: /// retrieval. If module_id is not nullptr, the final module id is returned. > Can you expand what module_id is used for. Would help to identify when to p Done http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-codegen.h@920 PS2, Line 920: llvm::Module* module_; > engine_cache_wrapper no longer owns an execution engine, so this comment is Done http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-codegen.cc File be/src/codegen/llvm-codegen.cc: http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-codegen.cc@a1185 PS2, Line 1185: > I thought this comment was kind of useful. And I see you still use it at li Done http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-codegen.cc@496 PS2, Line 496: engine_cache_ = make_shared<CodeGenObjectCache>(); > Why initialize it this way? You could also just pass "new CodegenObjectCach Done http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-codegen.cc@498 PS2, Line 498: RETURN_IF_ERROR(LoadIntrinsics()); > You could directly assign to execution_engine_ on line 479. Lots of extra m Done http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-codegen.cc@499 PS2, Line 499: > Why not assign directly to symbol_emitter_? Done http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-codegen.cc@1385 PS2, Line 1385: > Is this still right? Shouldn't it be the object cache size, since that's wh Done http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-object-cache-wrapper.h File be/src/codegen/llvm-object-cache-wrapper.h: http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-object-cache-wrapper.h@44 PS2, Line 44: > possibly other objects seems weird as there aren't other objects. Do we rea Done http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-object-cache-wrapper.cc File be/src/codegen/llvm-object-cache-wrapper.cc: http://gerrit.cloudera.org:8080/#/c/20733/2/be/src/codegen/llvm-object-cache-wrapper.cc@66 PS2, Line 66: > Is sizeof(CodeGenObjectCache) accounted for elsewhere? Yeah, this is a good point. Added here. -- To view, visit http://gerrit.cloudera.org:8080/20733 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic3c1b46bb9018ed0320817141785a3bdc41fa677 Gerrit-Change-Number: 20733 Gerrit-PatchSet: 3 Gerrit-Owner: Yida Wu <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Yida Wu <[email protected]> Gerrit-Comment-Date: Wed, 29 Nov 2023 14:37:12 +0000 Gerrit-HasComments: Yes
