Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite range find algorithm: update transition comment for memchr optimization for ARM64 #3386

Merged
merged 4 commits into from
Feb 10, 2023

Conversation

AlexGuteniev
Copy link
Contributor

@AlexGuteniev AlexGuteniev commented Feb 4, 2023

Towards #2866

Reportedly, VSO-1488938 is not reproducible.

closes microsoft#2866

Reportedly, VSO-1488938 is not reproducible.
If it still is, need to update transition comment instead.
@AlexGuteniev AlexGuteniev requested a review from a team as a code owner February 4, 2023 08:10
@StephanTLavavej StephanTLavavej changed the title find algorithm: Enable memchr optimization for ARM find algorithm: Enable memchr optimization for ARM64 Feb 4, 2023
@StephanTLavavej StephanTLavavej added the performance Must go faster label Feb 4, 2023
stl/inc/xutility Outdated Show resolved Hide resolved
Co-authored-by: Casey Carter <cartec69@gmail.com>
@AlexGuteniev AlexGuteniev changed the title find algorithm: Enable memchr optimization for ARM64 Infinite range find algorithm: unpdate transition comment for memchr optimization for ARM64 Feb 5, 2023
@AlexGuteniev AlexGuteniev changed the title Infinite range find algorithm: unpdate transition comment for memchr optimization for ARM64 Infinite range find algorithm: update transition comment for memchr optimization for ARM64 Feb 5, 2023
@AlexGuteniev
Copy link
Contributor Author

Is memchr for infinite size even broken on ARM64?

@CaseyCarter
Copy link
Member

Is memchr for infinite size even broken on ARM64?

The existence of VSO-1538014 suggests as much, but I'm not certain that it's been verified. Can anyone with ready access to an ARM64 box run:

#include <cstring>
#include <Windows.h>

int main() {
    void* p = ::VirtualAlloc(nullptr, 65536, MEM_RESERVE, PAGE_NOACCESS);
    void* p2 = ::VirtualAlloc(p, 4096, MEM_COMMIT, PAGE_READWRITE);
    char* p3 = (char*)p2 + 4093;
    p3[0] = '1';
    p3[1] = '2';
    p3[2] = '3';
    std::memchr(p3, '2', 1000);
}

and report back whether the program succeeds or AVs?

@strega-nil-ms
Copy link
Contributor

@CaseyCarter

PS C:\..\vctools\asan\llvm> cl /nologo test.cpp
test.cpp
PS C:\..\vctools\asan\llvm> .\test.exe
PS C:\..\vctools\asan\llvm> echo $LASTEXITCODE
-1073741819

that looks like an AV to me.

@StephanTLavavej
Copy link
Member

As I mentioned in Discord just now, I wonder what happens with x64/ARM64EC mixing, but I think we can go ahead here.

@StephanTLavavej StephanTLavavej self-assigned this Feb 10, 2023
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit c0ac135 into microsoft:main Feb 10, 2023
@StephanTLavavej
Copy link
Member

Thanks for extending the reach of this optimization! 🐇 🚀 🎉

@AlexGuteniev AlexGuteniev deleted the egg_today branch February 11, 2023 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
  翻译: