[clang] [HLSL] Implement the `lit` intrinsic (PR #134171)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 7 11:45:42 PDT 2025


================
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -std=hlsl202y -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify
+
+double4 test_double_inputs(double p0, double p1, double p2) {
+  return lit(p0, p1, p2);
+  // expected-error at -1 {{call to deleted function 'lit'}}
----------------
farzonl wrote:

I don't think there is an easy way to satisfy both conditions. I will say I'm noticing  a bunch of special cases in DXC where some intrinsics support implicit vector truncation and some don't and its becoming really annoying to apply a consistent rule here. For example dst allows implict vector truncation in DXC so we decided to do the same in clang https://github.com/llvm/llvm-project/pull/133828.

https://github.com/llvm/llvm-project/pull/134171


More information about the cfe-commits mailing list