[clang] [llvm] [CIR][X86] Implement lowering for sqrt builtins (PR #169310)
Andy Kaylor via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 3 15:58:47 PST 2025
================
@@ -0,0 +1,29 @@
+#include <immintrin.h>
+// Test X86-specific sqrt builtins
+
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
+// RUN: FileCheck --input-file=%t.cir %s
----------------
andykaylor wrote:
```suggestion
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t-cir.ll
// RUN: FileCheck --check-prefix=LLVM --input-file=%t-cir.ll %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll
// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s
```
This will run the test three ways:
1. Emitting CIR output
2. Generating CIR, then lowering it to LLVM IR for output
3. Generating LLVM IR output directly without going through CIR
The latter two sets of checks are useful for visually comparing the behavior of the CIR output to the traditional codegen.
https://github.com/llvm/llvm-project/pull/169310
More information about the llvm-commits
mailing list