Skip to content

Commit 5e568d7

Browse files
committed
Fix return type of reflect_vec_impl
1 parent 8cc4eed commit 5e568d7

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

clang/lib/Headers/hlsl/hlsl_detail.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ reflect_impl(T I, T N) {
8787
}
8888

8989
template <typename T, int L>
90-
constexpr enable_if_t<is_same<float, T>::value || is_same<half, T>::value, T>
91-
reflect_vec_impl(vector<T, L> I, vector<T, L> N) {
90+
constexpr vector<T, L> reflect_vec_impl(vector<T, L> I, vector<T, L> N) {
9291
#if (__has_builtin(__builtin_spirv_reflect))
9392
return __builtin_spirv_reflect(I, N);
9493
#else

clang/test/CodeGenHLSL/builtins/reflect.hlsl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ half test_reflect_half(half I, half N) {
4444
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) <2 x half> @_Z18test_reflect_half2Dv2_DhS_(
4545
// SPVCHECK-SAME: <2 x half> noundef nofpclass(nan inf) [[I:%.*]], <2 x half> noundef nofpclass(nan inf) [[N:%.*]]) local_unnamed_addr #[[ATTR0]] {
4646
// SPVCHECK-NEXT: [[ENTRY:.*:]]
47-
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn <2 x half> @llvm.spv.reflect.v2f16(<2 x half> [[I]], <2 x half> [[N]])
47+
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef <2 x half> @llvm.spv.reflect.v2f16(<2 x half> [[I]], <2 x half> [[N]])
4848
// SPVCHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <2 x half> [[SPV_REFLECT_I]], <2 x half> poison, <2 x i32> zeroinitializer
4949
// SPVCHECK-NEXT: ret <2 x half> [[SPLAT_SPLAT]]
5050
//
@@ -68,7 +68,7 @@ half2 test_reflect_half2(half2 I, half2 N) {
6868
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) <3 x half> @_Z18test_reflect_half3Dv3_DhS_(
6969
// SPVCHECK-SAME: <3 x half> noundef nofpclass(nan inf) [[I:%.*]], <3 x half> noundef nofpclass(nan inf) [[N:%.*]]) local_unnamed_addr #[[ATTR0]] {
7070
// SPVCHECK-NEXT: [[ENTRY:.*:]]
71-
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn <3 x half> @llvm.spv.reflect.v3f16(<3 x half> [[I]], <3 x half> [[N]])
71+
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef <3 x half> @llvm.spv.reflect.v3f16(<3 x half> [[I]], <3 x half> [[N]])
7272
// SPVCHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <3 x half> [[SPV_REFLECT_I]], <3 x half> poison, <3 x i32> zeroinitializer
7373
// SPVCHECK-NEXT: ret <3 x half> [[SPLAT_SPLAT]]
7474
//
@@ -92,7 +92,7 @@ half3 test_reflect_half3(half3 I, half3 N) {
9292
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) <4 x half> @_Z18test_reflect_half4Dv4_DhS_(
9393
// SPVCHECK-SAME: <4 x half> noundef nofpclass(nan inf) [[I:%.*]], <4 x half> noundef nofpclass(nan inf) [[N:%.*]]) local_unnamed_addr #[[ATTR0]] {
9494
// SPVCHECK-NEXT: [[ENTRY:.*:]]
95-
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn <4 x half> @llvm.spv.reflect.v4f16(<4 x half> [[I]], <4 x half> [[N]])
95+
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef <4 x half> @llvm.spv.reflect.v4f16(<4 x half> [[I]], <4 x half> [[N]])
9696
// SPVCHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <4 x half> [[SPV_REFLECT_I]], <4 x half> poison, <4 x i32> zeroinitializer
9797
// SPVCHECK-NEXT: ret <4 x half> [[SPLAT_SPLAT]]
9898
//
@@ -138,7 +138,7 @@ float test_reflect_float(float I, float N) {
138138
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) <2 x float> @_Z19test_reflect_float2Dv2_fS_(
139139
// SPVCHECK-SAME: <2 x float> noundef nofpclass(nan inf) [[I:%.*]], <2 x float> noundef nofpclass(nan inf) [[N:%.*]]) local_unnamed_addr #[[ATTR0]] {
140140
// SPVCHECK-NEXT: [[ENTRY:.*:]]
141-
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.spv.reflect.v2f32(<2 x float> [[I]], <2 x float> [[N]])
141+
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef <2 x float> @llvm.spv.reflect.v2f32(<2 x float> [[I]], <2 x float> [[N]])
142142
// SPVCHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <2 x float> [[SPV_REFLECT_I]], <2 x float> poison, <2 x i32> zeroinitializer
143143
// SPVCHECK-NEXT: ret <2 x float> [[SPLAT_SPLAT]]
144144
//
@@ -162,7 +162,7 @@ float2 test_reflect_float2(float2 I, float2 N) {
162162
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) <3 x float> @_Z19test_reflect_float3Dv3_fS_(
163163
// SPVCHECK-SAME: <3 x float> noundef nofpclass(nan inf) [[I:%.*]], <3 x float> noundef nofpclass(nan inf) [[N:%.*]]) local_unnamed_addr #[[ATTR0]] {
164164
// SPVCHECK-NEXT: [[ENTRY:.*:]]
165-
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.spv.reflect.v3f32(<3 x float> [[I]], <3 x float> [[N]])
165+
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef <3 x float> @llvm.spv.reflect.v3f32(<3 x float> [[I]], <3 x float> [[N]])
166166
// SPVCHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <3 x float> [[SPV_REFLECT_I]], <3 x float> poison, <3 x i32> zeroinitializer
167167
// SPVCHECK-NEXT: ret <3 x float> [[SPLAT_SPLAT]]
168168
//
@@ -186,7 +186,7 @@ float3 test_reflect_float3(float3 I, float3 N) {
186186
// SPVCHECK-LABEL: define spir_func noundef nofpclass(nan inf) <4 x float> @_Z19test_reflect_float4Dv4_fS_(
187187
// SPVCHECK-SAME: <4 x float> noundef nofpclass(nan inf) [[I:%.*]], <4 x float> noundef nofpclass(nan inf) [[N:%.*]]) local_unnamed_addr #[[ATTR0]] {
188188
// SPVCHECK-NEXT: [[ENTRY:.*:]]
189-
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.spv.reflect.v4f32(<4 x float> [[I]], <4 x float> [[N]])
189+
// SPVCHECK-NEXT: [[SPV_REFLECT_I:%.*]] = tail call reassoc nnan ninf nsz arcp afn noundef <4 x float> @llvm.spv.reflect.v4f32(<4 x float> [[I]], <4 x float> [[N]])
190190
// SPVCHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <4 x float> [[SPV_REFLECT_I]], <4 x float> poison, <4 x i32> zeroinitializer
191191
// SPVCHECK-NEXT: ret <4 x float> [[SPLAT_SPLAT]]
192192
//

0 commit comments

Comments
 (0)