Skip to content

[Fix]Fix implicit type conversion for format_ip.h/hash_map_context.h/hash_…#43604

Closed
wangbo wants to merge 1 commit intoapache:masterfrom
wangbo:1108_compile_check
Closed

[Fix]Fix implicit type conversion for format_ip.h/hash_map_context.h/hash_…#43604
wangbo wants to merge 1 commit intoapache:masterfrom
wangbo:1108_compile_check

Conversation

@wangbo
Copy link
Copy Markdown
Contributor

@wangbo wangbo commented Nov 11, 2024

What problem does this PR solve?

Fix implicit type conversion for format_ip.h/hash_map_context.h/hash_table.h/memcmp_small.h

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@doris-robot
Copy link
Copy Markdown

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@wangbo wangbo force-pushed the 1108_compile_check branch 2 times, most recently from 2efbe6d to 08a9c8a Compare November 11, 2024 08:37
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions


for (size_t offset = 0; offset < min_size; offset += 16) {
uint16_t mask = _mm_movemask_epi8(
uint16_t mask = (uint16_t)_mm_movemask_epi8(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]

Suggested change
uint16_t mask = (uint16_t)_mm_movemask_epi8(
auto mask = (uint16_t)_mm_movemask_epi8(

int memcmp_small_allow_overflow15(const Char* a, const Char* b, size_t size) {
for (size_t offset = 0; offset < size; offset += 16) {
uint16_t mask = _mm_movemask_epi8(
uint16_t mask = (uint16_t)_mm_movemask_epi8(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]

Suggested change
uint16_t mask = (uint16_t)_mm_movemask_epi8(
auto mask = (uint16_t)_mm_movemask_epi8(


for (size_t offset = 0; offset < a_size; offset += 16) {
uint16_t mask = _mm_movemask_epi8(
uint16_t mask = (uint16_t)_mm_movemask_epi8(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]

Suggested change
uint16_t mask = (uint16_t)_mm_movemask_epi8(
auto mask = (uint16_t)_mm_movemask_epi8(

int memcmp_small_multiple_of16(const Char* a, const Char* b, size_t size) {
for (size_t offset = 0; offset < size; offset += 16) {
uint16_t mask = _mm_movemask_epi8(
uint16_t mask = (uint16_t)_mm_movemask_epi8(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]

Suggested change
uint16_t mask = (uint16_t)_mm_movemask_epi8(
auto mask = (uint16_t)_mm_movemask_epi8(

uint16_t mask =
_mm_movemask_epi8(_mm_cmpeq_epi8(_mm_loadu_si128(reinterpret_cast<const __m128i*>(a)),
_mm_loadu_si128(reinterpret_cast<const __m128i*>(b))));
uint16_t mask = (uint16_t)_mm_movemask_epi8(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]

Suggested change
uint16_t mask = (uint16_t)_mm_movemask_epi8(
auto mask = (uint16_t)_mm_movemask_epi8(


for (size_t offset = 0; offset < size; offset += 16) {
uint16_t mask = _mm_movemask_epi8(
uint16_t mask = (uint16_t)_mm_movemask_epi8(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]

Suggested change
uint16_t mask = (uint16_t)_mm_movemask_epi8(
auto mask = (uint16_t)_mm_movemask_epi8(

@wangbo wangbo force-pushed the 1108_compile_check branch from 08a9c8a to eb5a052 Compare November 11, 2024 08:41
@wangbo
Copy link
Copy Markdown
Contributor Author

wangbo commented Nov 11, 2024

run buildall

@doris-robot
Copy link
Copy Markdown

TeamCity be ut coverage result:
Function Coverage: 37.78% (9843/26054)
Line Coverage: 29.06% (82292/283199)
Region Coverage: 28.18% (42304/150120)
Branch Coverage: 24.77% (21448/86604)
Coverage Report: http://coverage.selectdb-in.cc/coverage/eb5a052f08598ee498408efd410d135176231988_eb5a052f08598ee498408efd410d135176231988/report/index.html

size_degree = num_elems <= 1 ? initial_size_degree
: (initial_size_degree > fill_capacity ? initial_size_degree
: fill_capacity);
size_degree = (doris::vectorized::UInt8)(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change size_degree to uint32 or uint64?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because size_degree = log2(xxx) when set_buf_size, so uint8 is enough.

@github-actions
Copy link
Copy Markdown
Contributor

We're closing this PR because it hasn't been updated in a while.
This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and feel free a maintainer to remove the Stale tag!

@github-actions github-actions bot added the Stale label May 12, 2025
@wangbo wangbo closed this May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants