Tim Armstrong has posted comments on this change. ( http://gerrit.cloudera.org:8080/9063 )
Change subject: IMPALA-5801: [draft] Clean up codegen GetType() interface ...................................................................... Patch Set 1: (8 comments) http://gerrit.cloudera.org:8080/#/c/9063/1/be/src/codegen/llvm-codegen.h File be/src/codegen/llvm-codegen.h: http://gerrit.cloudera.org:8080/#/c/9063/1/be/src/codegen/llvm-codegen.h@253 PS1, Line 253: GetInternalRepresentation Maybe GetSlotType() since it's how the slot within a Tuple is represented? We use that terminology in some other places. http://gerrit.cloudera.org:8080/#/c/9063/1/be/src/codegen/llvm-codegen.h@263 PS1, Line 263: GetType I wonder if we should rename this to GetNamedType() or GetTypeFromModule() or something along those lines? http://gerrit.cloudera.org:8080/#/c/9063/1/be/src/codegen/llvm-codegen.h@496 PS1, Line 496: llvm::Type* boolean_type() { return GetInternalRepresentation(TYPE_BOOLEAN); } > Maybe bool_type would be more logical in a c++ context. Makes sense to me. http://gerrit.cloudera.org:8080/#/c/9063/1/be/src/codegen/llvm-codegen.h@497 PS1, Line 497: llvm::Type* i8_type() { return GetInternalRepresentation(TYPE_TINYINT); } Any reason not to call the LLVM functions directly, like i128_type() i.e. llvm::Type::getInt8Ty(context()); http://gerrit.cloudera.org:8080/#/c/9063/1/be/src/codegen/llvm-codegen.h@497 PS1, Line 497: llvm::Type* i8_type() { return GetInternalRepresentation(TYPE_TINYINT); } : llvm::Type* i16_type() { return GetInternalRepresentation(TYPE_SMALLINT); } : llvm::Type* i32_type() { return GetInternalRepresentation(TYPE_INT); } : llvm::Type* i64_type() { return GetInternalRepresentation(TYPE_BIGINT); } > I have chosen i8_type() instead of int8_type(), because i128_type() already The short type names seem good. http://gerrit.cloudera.org:8080/#/c/9063/1/be/src/codegen/llvm-codegen.h@524 PS1, Line 524: I8Constant I think GetI8Constant() would be more consistent with other name (although more verbose unfortunately). http://gerrit.cloudera.org:8080/#/c/9063/1/be/src/codegen/llvm-codegen.h@525 PS1, Line 525: return GetIntConstant(TYPE_TINYINT, val); We could also just call the LLVM function directly here. http://gerrit.cloudera.org:8080/#/c/9063/1/be/src/exprs/slot-ref.cc File be/src/exprs/slot-ref.cc: http://gerrit.cloudera.org:8080/#/c/9063/1/be/src/exprs/slot-ref.cc@191 PS1, Line 191: llvm::Value* tuple_offset = llvm::ConstantInt::get(codegen->i32_type(), tuple_idx_); I feel like this is more readable, thank you. -- To view, visit http://gerrit.cloudera.org:8080/9063 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib146ca21af82023b0b460f813eae3435b4b2eb77 Gerrit-Change-Number: 9063 Gerrit-PatchSet: 1 Gerrit-Owner: Csaba Ringhofer <csringho...@cloudera.com> Gerrit-Reviewer: Csaba Ringhofer <csringho...@cloudera.com> Gerrit-Reviewer: Lars Volker <l...@cloudera.com> Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com> Gerrit-Comment-Date: Mon, 22 Jan 2018 22:05:00 +0000 Gerrit-HasComments: Yes