-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add test for issue 106269 #124299
Add test for issue 106269 #124299
Conversation
rustbot has assigned @Mark-Simulacrum. Use |
r? @nikic since #106269 (comment) sounded to me like there might be a better way to test here (e.g., detecting the memcmp somehow?) |
1af717d
to
11b0e9a
Compare
The IR looks like this - it's only during codegen that it can be turned into a single comparison define noundef zeroext i1 @eq1(ptr noalias nocapture noundef readonly align 1 dereferenceable(4) %s1, ptr noalias nocapture noundef readonly align 1 dereferenceable(4) %s2) unnamed_addr {
start:
%_4 = load i8, ptr %s1, align 1
%_5 = load i8, ptr %s2, align 1
%_3 = icmp eq i8 %_4, %_5
br i1 %_3, label %bb1, label %bb8
bb1:
%0 = getelementptr inbounds i8, ptr %s1, i64 1
%_7 = load i8, ptr %0, align 1
%1 = getelementptr inbounds i8, ptr %s2, i64 1
%_8 = load i8, ptr %1, align 1
%_6 = icmp eq i8 %_7, %_8
br i1 %_6, label %bb2, label %bb8
bb2:
%2 = getelementptr inbounds i8, ptr %s1, i64 2
%_10 = load i8, ptr %2, align 1
%3 = getelementptr inbounds i8, ptr %s2, i64 2
%_11 = load i8, ptr %3, align 1
%_9 = icmp eq i8 %_10, %_11
br i1 %_9, label %bb3, label %bb8
bb3:
%4 = getelementptr inbounds i8, ptr %s1, i64 3
%_12 = load i8, ptr %4, align 1
%5 = getelementptr inbounds i8, ptr %s2, i64 3
%_13 = load i8, ptr %5, align 1
%6 = icmp eq i8 %_12, %_13
br label %bb8
bb8:
%_0.sroa.0.0 = phi i1 [ %6, %bb3 ], [ false, %bb2 ], [ false, %bb1 ], [ false, %start ]
ret i1 %_0.sroa.0.0
} |
@bors r+ rollup=iffy Assembly tests are the best we can do for this right now. After llvm/llvm-project#77370 we'd be able to use IR tests for these. |
Add test for issue 106269 Closes rust-lang#106269 Made this an assembly test as the LLVM codegen is still quite verbose and doesn't really indicate the behaviour we want
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
11b0e9a
to
7032c92
Compare
Looks like there's always a
for code on Darwin @bors r=nikic |
Rollup of 4 pull requests Successful merges: - rust-lang#124280 (Port repr128-dwarf run-make test to rmake) - rust-lang#124299 (Add test for issue 106269) - rust-lang#124553 (Write `git-commit-{sha,info}` for Cargo in source tarballs) - rust-lang#124561 (Add `normalize()` in run-make `Diff` type) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#124299 - clubby789:106269-test, r=nikic Add test for issue 106269 Closes rust-lang#106269 Made this an assembly test as the LLVM codegen is still quite verbose and doesn't really indicate the behaviour we want
Closes #106269
Made this an assembly test as the LLVM codegen is still quite verbose and doesn't really indicate the behaviour we want