-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[CIR] Upstream X86 builtin clflush, fence and pause #167401
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
Changes from 8 commits
539eebe
de47432
26d8914
93c0ded
9eb5199
776f5c1
8a07992
e481360
a665f70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +sse -fclangir -emit-cir -o %t.cir -Wall -Werror | ||
| // RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s | ||
| // RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +sse -fclangir -emit-llvm -o %t.ll -Wall -Werror | ||
| // RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s | ||
|
|
||
| // RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +sse -fno-signed-char -fclangir -emit-cir -o %t.cir -Wall -Werror | ||
| // RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s | ||
| // RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +sse -fclangir -emit-llvm -o %t.ll -Wall -Werror | ||
| // RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s | ||
|
|
||
| // This test mimics clang/test/CodeGen/X86/sse-builtins.c, which eventually | ||
| // CIR shall be able to support fully. | ||
|
|
||
| #include <immintrin.h> | ||
|
|
||
|
|
||
| void test_mm_sfence(void) { | ||
| // CIR-LABEL: test_mm_sfence | ||
| // LLVM-LABEL: test_mm_sfence | ||
| _mm_sfence(); | ||
| // CIR: {{%.*}} = cir.call_llvm_intrinsic "x86.sse.sfence" : () -> !void | ||
| // LLVM: call void @llvm.x86.sse.sfence() | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,47 @@ | ||||||
| // RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +sse2 -fclangir -emit-cir -o %t.cir -Wall -Werror | ||||||
| // RUN: FileCheck --check-prefixes=CIR-CHECK --input-file=%t.cir %s | ||||||
|
||||||
| // RUN: FileCheck --check-prefixes=CIR-CHECK --input-file=%t.cir %s | |
| // RUN: FileCheck --check-prefixes=CIR --input-file=%t.cir %s |
Can you replace all instances of CIR-CHECK with CIR and LLVM-CHECK with LLVM? I'm not sure what the person who implemented that in the incubator was trying to accomplish, but it's not necessary. As currently written, this test will ignore the CIR-LABEL and LLVM-LABEL checks. Those are label checks for the CIR and LLVM prefixes.
Also, please add OGCG checks here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. What is the point of adding CIR-LABEL instead of just CIR? I've seen CIR-NEXT and CIR-SAME as well, are there docs about what these do?
Edit: Ahh I found this: https://llvm.org/docs/CommandGuide/FileCheck.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andykaylor Hi, you mentioned you would like to see this PR merged before the other builtin upstreaming PRs, do you think we can land it now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add the OGCG checks. It's useful to manually verify that we're generating equivalent code.