https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/130320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/130320
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -22,56 +22,136 @@
//
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
-// RUN: -DFNATTRS="spir_func noundef nofpclass(nan inf)" -DTY
https://github.com/kmpeng updated
https://github.com/llvm/llvm-project/pull/130320
>From fd3db87977a52d7560d9eec15522c8afb85c9171 Mon Sep 17 00:00:00 2001
From: kmpeng
Date: Tue, 25 Feb 2025 14:50:09 -0800
Subject: [PATCH 01/10] start implementation
---
clang/lib/Headers/hlsl/hlsl_detail.h |
https://github.com/kmpeng created
https://github.com/llvm/llvm-project/pull/131035
Fixes #131024.
- Fixes template for scalar and vector `fmod` intrinsic overloads
- Fixes `fmod` Sema test
>From b33ab9d6a3c87c59ca9b2d3e8e5001f1d79bb620 Mon Sep 17 00:00:00 2001
From: kmpeng
Date: Tue, 11 Mar 20
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 %s -triple spirv-pc-vulkan-compute -verify
+
+typedef float float2 __attribute__((ext_vector_type(2)));
+
+float2 test_no_second_arg(float2 p0) {
+ return __builtin_spirv_smoothstep(p0);
+ // expected-error@-1 {{too few arguments to function
https://github.com/kmpeng updated
https://github.com/llvm/llvm-project/pull/132288
>From 0a5da660c5aae053d87d556e59f98c121d916b79 Mon Sep 17 00:00:00 2001
From: kmpeng
Date: Tue, 18 Mar 2025 13:25:10 -0700
Subject: [PATCH 1/7] create int_spv_smoothstep intrinsic, create smoothstep
lowering & m
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmpeng created
https://github.com/llvm/llvm-project/pull/134171
Closes #99135.
Tasks completed:
- Wrote implementation in `hlsl_intrinsics.h`/`hlsl_intrinsic_helpers.h` that
matches DXC
- Created overloads in `hlsl_compat_overloads.h` that take doubles/ints and
explicitly
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmpeng deleted
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -280,6 +280,22 @@ constexpr bool4 isinf(double4 V) { return
isinf((float4)V); }
_DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp)
_DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp)
+//===--===//
+// lit builtins overloa
https://github.com/kmpeng updated
https://github.com/llvm/llvm-project/pull/134171
>From 719bb94279f64f134c826faa22898e4e549bb23c Mon Sep 17 00:00:00 2001
From: kmpeng
Date: Thu, 27 Mar 2025 14:39:27 -0700
Subject: [PATCH 1/7] finished lit implementation, added codegen and sema tests
---
.../
@@ -253,6 +253,37 @@ const inline float
length(__detail::HLSL_FIXED_VECTOR X) {
return __detail::length_vec_impl(X);
}
+//===--===//
+// lit builtins
+//===--
@@ -0,0 +1,36 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 5
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple
dxil-pc-shadermodel6.3-library %s -fnative-half-type -emit-llvm -O1 -o - |
FileCheck %s
+
+// CHECK
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -101,6 +101,16 @@ constexpr vector smoothstep_vec_impl(vector
Min, vector Max,
#endif
}
+template constexpr vector lit_impl(T NDotL, T NDotH, T M) {
+ bool DiffuseCond = NDotL < 0;
+ T Diffuse = select(DiffuseCond, 0, NDotL);
+ vector Result = {1, Diffuse, 0, 1};
+ bo
https://github.com/kmpeng updated
https://github.com/llvm/llvm-project/pull/134171
>From 719bb94279f64f134c826faa22898e4e549bb23c Mon Sep 17 00:00:00 2001
From: kmpeng
Date: Thu, 27 Mar 2025 14:39:27 -0700
Subject: [PATCH 1/9] finished lit implementation, added codegen and sema tests
---
.../
@@ -253,6 +253,37 @@ const inline float
length(__detail::HLSL_FIXED_VECTOR X) {
return __detail::length_vec_impl(X);
}
+//===--===//
+// lit builtins
+//===--
@@ -280,6 +280,22 @@ constexpr bool4 isinf(double4 V) { return
isinf((float4)V); }
_DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp)
_DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp)
+//===--===//
+// lit builtins overloa
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/134171
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -280,6 +280,22 @@ constexpr bool4 isinf(double4 V) { return
isinf((float4)V); }
_DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp)
_DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp)
+//===--===//
+// lit builtins overloa
@@ -98,21 +110,98 @@ void applySPIRVDistance(MachineInstr &MI,
MachineRegisterInfo &MRI,
SPIRVGlobalRegistry *GR =
MI.getMF()->getSubtarget().getSPIRVGlobalRegistry();
- auto RemoveAllUses = [&](Register Reg) {
-SmallVector UsesToErase(
-llvm::make_pointe
https://github.com/kmpeng updated
https://github.com/llvm/llvm-project/pull/139959
>From be7df595c1df0f310a1941da3d3ac3529270241e Mon Sep 17 00:00:00 2001
From: kmpeng
Date: Tue, 29 Apr 2025 16:46:08 -0700
Subject: [PATCH 1/5] WIP - debug `matchSelectToFaceForward`
---
.../lib/Headers/hlsl/hl
@@ -98,21 +110,98 @@ void applySPIRVDistance(MachineInstr &MI,
MachineRegisterInfo &MRI,
SPIRVGlobalRegistry *GR =
MI.getMF()->getSubtarget().getSPIRVGlobalRegistry();
- auto RemoveAllUses = [&](Register Reg) {
-SmallVector UsesToErase(
-llvm::make_pointe
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/139959
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/139959
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,63 @@
+# RUN: llc -verify-machineinstrs -O0 -mtriple spirv-unknown-unknown
-run-pass=spirv-prelegalizer-combiner %s -o - | FileCheck %s
+# REQUIRES: asserts
+---
+name:faceforward_instcombine_float
+tracksRegLiveness: true
+legalized: true
+body:
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/139959
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/139959
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kmpeng created
https://github.com/llvm/llvm-project/pull/139959
Tasks completed:
- instCombine `select(fcmp(dot(p2, p3), 0), p1, 0 - p1)` to `faceforward(p1,
p2, p3)`
- Remove HLSL `faceforward` intrinsic's SPIR-V fast path
- Add instCombine tests to `prelegalizercombiner-sel
@@ -0,0 +1,63 @@
+# RUN: llc -verify-machineinstrs -O0 -mtriple spirv-unknown-unknown
-run-pass=spirv-prelegalizer-combiner %s -o - | FileCheck %s
+# REQUIRES: asserts
+---
+name:faceforward_instcombine_float
+tracksRegLiveness: true
+legalized: true
+body:
@@ -98,21 +110,98 @@ void applySPIRVDistance(MachineInstr &MI,
MachineRegisterInfo &MRI,
SPIRVGlobalRegistry *GR =
MI.getMF()->getSubtarget().getSPIRVGlobalRegistry();
- auto RemoveAllUses = [&](Register Reg) {
-SmallVector UsesToErase(
-llvm::make_pointe
https://github.com/kmpeng edited
https://github.com/llvm/llvm-project/pull/139959
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
101 - 137 of 137 matches
Mail list logo