Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[libc++] Suboptimal codegen for std::equal(std::byte) #132672

Copy link
Copy link
@halbi2

Description

@halbi2
Issue body actions
#include <algorithm>
bool f(char* a, char* b) {
  return std::equal(a, a+16, b, b+16);
}
bool g(std::byte* a, std::byte* b) {
  return std::equal(a, a+16, b, b+16);
}

f generates pcmpeqb. g generates a loop. std::equal should be aware that std::byte is functionally the same as char.

#89820 could relate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.