llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-directx

Author: Farzon Lotfi (farzonl)

<details>
<summary>Changes</summary>

Reverts llvm/llvm-project#<!-- -->165109

---

Patch is 35.06 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/182741.diff


15 Files Affected:

- (modified) clang/include/clang/Basic/Builtins.td (-6) 
- (modified) clang/lib/CodeGen/CGHLSLBuiltins.cpp (+7-33) 
- (modified) clang/lib/Headers/hlsl/hlsl_alias_intrinsics.h (-123) 
- (modified) clang/lib/Sema/SemaHLSL.cpp (+1-2) 
- (removed) clang/test/CodeGenHLSL/builtins/WaveActiveProduct.hlsl (-45) 
- (removed) clang/test/SemaHLSL/BuiltIns/WaveActiveProduct-errors.hlsl (-28) 
- (modified) llvm/include/llvm/IR/IntrinsicsDirectX.td (-2) 
- (modified) llvm/include/llvm/IR/IntrinsicsSPIRV.td (-1) 
- (modified) llvm/lib/Target/DirectX/DXIL.td (-10) 
- (modified) llvm/lib/Target/DirectX/DXILShaderFlags.cpp (-2) 
- (modified) llvm/lib/Target/DirectX/DirectXTargetTransformInfo.cpp (-2) 
- (modified) llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp (+38-55) 
- (modified) llvm/test/CodeGen/DirectX/ShaderFlags/wave-ops.ll (-14) 
- (removed) llvm/test/CodeGen/DirectX/WaveActiveProduct.ll (-143) 
- (removed) llvm/test/CodeGen/SPIRV/hlsl-intrinsics/WaveActiveProduct.ll (-41) 


``````````diff
diff --git a/clang/include/clang/Basic/Builtins.td 
b/clang/include/clang/Basic/Builtins.td
index 6880a6e177c00..78dd26aa2c455 100644
--- a/clang/include/clang/Basic/Builtins.td
+++ b/clang/include/clang/Basic/Builtins.td
@@ -5174,12 +5174,6 @@ def HLSLWaveActiveSum : LangBuiltin<"HLSL_LANG"> {
   let Prototype = "void (...)";
 }
 
-def HLSLWaveActiveProduct : LangBuiltin<"HLSL_LANG"> {
-  let Spellings = ["__builtin_hlsl_wave_active_product"];
-  let Attributes = [NoThrow, Const];
-  let Prototype = "void (...)";
-}
-
 def HLSLWaveGetLaneIndex : LangBuiltin<"HLSL_LANG"> {
   let Spellings = ["__builtin_hlsl_wave_get_lane_index"];
   let Attributes = [NoThrow, Const];
diff --git a/clang/lib/CodeGen/CGHLSLBuiltins.cpp 
b/clang/lib/CodeGen/CGHLSLBuiltins.cpp
index 6cd379fb6ba3d..70891eac39425 100644
--- a/clang/lib/CodeGen/CGHLSLBuiltins.cpp
+++ b/clang/lib/CodeGen/CGHLSLBuiltins.cpp
@@ -331,7 +331,7 @@ static Intrinsic::ID getFirstBitHighIntrinsic(CGHLSLRuntime 
&RT, QualType QT) {
 
 // Return wave active sum that corresponds to the QT scalar type
 static Intrinsic::ID getWaveActiveSumIntrinsic(llvm::Triple::ArchType Arch,
-                                               QualType QT) {
+                                               CGHLSLRuntime &RT, QualType QT) 
{
   switch (Arch) {
   case llvm::Triple::spirv:
     return Intrinsic::spv_wave_reduce_sum;
@@ -346,23 +346,6 @@ static Intrinsic::ID 
getWaveActiveSumIntrinsic(llvm::Triple::ArchType Arch,
   }
 }
 
-// Return wave active product that corresponds to the QT scalar type
-static Intrinsic::ID getWaveActiveProductIntrinsic(llvm::Triple::ArchType Arch,
-                                                   QualType QT) {
-  switch (Arch) {
-  case llvm::Triple::spirv:
-    return Intrinsic::spv_wave_product;
-  case llvm::Triple::dxil: {
-    if (QT->isUnsignedIntegerType())
-      return Intrinsic::dx_wave_uproduct;
-    return Intrinsic::dx_wave_product;
-  }
-  default:
-    llvm_unreachable("Intrinsic WaveActiveProduct"
-                     " not supported by target architecture");
-  }
-}
-
 static Intrinsic::ID getPrefixCountBitsIntrinsic(llvm::Triple::ArchType Arch) {
   switch (Arch) {
   case llvm::Triple::spirv:
@@ -1138,27 +1121,18 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned 
BuiltinID,
         ArrayRef{OpExpr});
   }
   case Builtin::BI__builtin_hlsl_wave_active_sum: {
-    // Due to the use of variadic arguments, explicitly retrieve argument
+    // Due to the use of variadic arguments, explicitly retreive argument
     Value *OpExpr = EmitScalarExpr(E->getArg(0));
     Intrinsic::ID IID = getWaveActiveSumIntrinsic(
-        getTarget().getTriple().getArch(), E->getArg(0)->getType());
+        getTarget().getTriple().getArch(), CGM.getHLSLRuntime(),
+        E->getArg(0)->getType());
 
     return EmitRuntimeCall(Intrinsic::getOrInsertDeclaration(
                                &CGM.getModule(), IID, {OpExpr->getType()}),
                            ArrayRef{OpExpr}, "hlsl.wave.active.sum");
   }
-  case Builtin::BI__builtin_hlsl_wave_active_product: {
-    // Due to the use of variadic arguments, explicitly retrieve argument
-    Value *OpExpr = EmitScalarExpr(E->getArg(0));
-    Intrinsic::ID IID = getWaveActiveProductIntrinsic(
-        getTarget().getTriple().getArch(), E->getArg(0)->getType());
-
-    return EmitRuntimeCall(Intrinsic::getOrInsertDeclaration(
-                               &CGM.getModule(), IID, {OpExpr->getType()}),
-                           ArrayRef{OpExpr}, "hlsl.wave.active.product");
-  }
   case Builtin::BI__builtin_hlsl_wave_active_max: {
-    // Due to the use of variadic arguments, explicitly retrieve argument
+    // Due to the use of variadic arguments, explicitly retreive argument
     Value *OpExpr = EmitScalarExpr(E->getArg(0));
     QualType QT = E->getArg(0)->getType();
     Intrinsic::ID IID;
@@ -1172,7 +1146,7 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned 
BuiltinID,
                            ArrayRef{OpExpr}, "hlsl.wave.active.max");
   }
   case Builtin::BI__builtin_hlsl_wave_active_min: {
-    // Due to the use of variadic arguments, explicitly retrieve argument
+    // Due to the use of variadic arguments, explicitly retreive argument
     Value *OpExpr = EmitScalarExpr(E->getArg(0));
     QualType QT = E->getArg(0)->getType();
     Intrinsic::ID IID;
@@ -1213,7 +1187,7 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned 
BuiltinID,
         Intrinsic::getOrInsertDeclaration(&CGM.getModule(), ID));
   }
   case Builtin::BI__builtin_hlsl_wave_read_lane_at: {
-    // Due to the use of variadic arguments we must explicitly retrieve them 
and
+    // Due to the use of variadic arguments we must explicitly retreive them 
and
     // create our function type.
     Value *OpExpr = EmitScalarExpr(E->getArg(0));
     Value *OpIndex = EmitScalarExpr(E->getArg(1));
diff --git a/clang/lib/Headers/hlsl/hlsl_alias_intrinsics.h 
b/clang/lib/Headers/hlsl/hlsl_alias_intrinsics.h
index 979e19cd0035a..2543401bdfbf9 100644
--- a/clang/lib/Headers/hlsl/hlsl_alias_intrinsics.h
+++ b/clang/lib/Headers/hlsl/hlsl_alias_intrinsics.h
@@ -2908,129 +2908,6 @@ __attribute__((convergent)) double3 
WaveActiveSum(double3);
 _HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_sum)
 __attribute__((convergent)) double4 WaveActiveSum(double4);
 
-//===----------------------------------------------------------------------===//
-// WaveActiveProduct builtins
-//===----------------------------------------------------------------------===//
-
-_HLSL_16BIT_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) half WaveActiveProduct(half);
-_HLSL_16BIT_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) half2 WaveActiveProduct(half2);
-_HLSL_16BIT_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) half3 WaveActiveProduct(half3);
-_HLSL_16BIT_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) half4 WaveActiveProduct(half4);
-
-#ifdef __HLSL_ENABLE_16_BIT
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) int16_t WaveActiveProduct(int16_t);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) int16_t2 WaveActiveProduct(int16_t2);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) int16_t3 WaveActiveProduct(int16_t3);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) int16_t4 WaveActiveProduct(int16_t4);
-
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) uint16_t WaveActiveProduct(uint16_t);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) uint16_t2 WaveActiveProduct(uint16_t2);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) uint16_t3 WaveActiveProduct(uint16_t3);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) uint16_t4 WaveActiveProduct(uint16_t4);
-#endif
-
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) int WaveActiveProduct(int);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) int2 WaveActiveProduct(int2);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) int3 WaveActiveProduct(int3);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) int4 WaveActiveProduct(int4);
-
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) uint WaveActiveProduct(uint);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) uint2 WaveActiveProduct(uint2);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) uint3 WaveActiveProduct(uint3);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) uint4 WaveActiveProduct(uint4);
-
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) int64_t WaveActiveProduct(int64_t);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) int64_t2 WaveActiveProduct(int64_t2);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) int64_t3 WaveActiveProduct(int64_t3);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) int64_t4 WaveActiveProduct(int64_t4);
-
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) uint64_t WaveActiveProduct(uint64_t);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) uint64_t2 WaveActiveProduct(uint64_t2);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) uint64_t3 WaveActiveProduct(uint64_t3);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) uint64_t4 WaveActiveProduct(uint64_t4);
-
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) float WaveActiveProduct(float);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) float2 WaveActiveProduct(float2);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) float3 WaveActiveProduct(float3);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) float4 WaveActiveProduct(float4);
-
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) double WaveActiveProduct(double);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) double2 WaveActiveProduct(double2);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) double3 WaveActiveProduct(double3);
-_HLSL_AVAILABILITY(shadermodel, 6.0)
-_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_active_product)
-__attribute__((convergent)) double4 WaveActiveProduct(double4);
-
 
//===----------------------------------------------------------------------===//
 // WavePrefixSum builtins
 
//===----------------------------------------------------------------------===//
diff --git a/clang/lib/Sema/SemaHLSL.cpp b/clang/lib/Sema/SemaHLSL.cpp
index f802b9ae7e420..911dba40d3bde 100644
--- a/clang/lib/Sema/SemaHLSL.cpp
+++ b/clang/lib/Sema/SemaHLSL.cpp
@@ -3811,8 +3811,7 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned 
BuiltinID, CallExpr *TheCall) {
   }
   case Builtin::BI__builtin_hlsl_wave_active_max:
   case Builtin::BI__builtin_hlsl_wave_active_min:
-  case Builtin::BI__builtin_hlsl_wave_active_sum:
-  case Builtin::BI__builtin_hlsl_wave_active_product: {
+  case Builtin::BI__builtin_hlsl_wave_active_sum: {
     if (SemaRef.checkArgCount(TheCall, 1))
       return true;
 
diff --git a/clang/test/CodeGenHLSL/builtins/WaveActiveProduct.hlsl 
b/clang/test/CodeGenHLSL/builtins/WaveActiveProduct.hlsl
deleted file mode 100644
index 3a8320e7333fc..0000000000000
--- a/clang/test/CodeGenHLSL/builtins/WaveActiveProduct.hlsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -triple \
-// RUN:   dxil-pc-shadermodel6.3-compute %s -emit-llvm -disable-llvm-passes -o 
- | \
-// RUN:   FileCheck %s --check-prefixes=CHECK,CHECK-DXIL
-// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -triple \
-// RUN:   spirv-pc-vulkan-compute %s -emit-llvm -disable-llvm-passes -o - | \
-// RUN:   FileCheck %s --check-prefixes=CHECK,CHECK-SPIRV
-
-// Test basic lowering to runtime function call.
-
-// CHECK-LABEL: test_int
-int test_int(int expr) {
-  // CHECK-SPIRV:  %[[RET:.*]] = call spir_func [[TY:.*]] 
@llvm.spv.wave.product.i32([[TY]] %[[#]])
-  // CHECK-DXIL:  %[[RET:.*]] = call [[TY:.*]] 
@llvm.dx.wave.product.i32([[TY]] %[[#]])
-  // CHECK:  ret [[TY]] %[[RET]]
-  return WaveActiveProduct(expr);
-}
-
-// CHECK-DXIL: declare [[TY]] @llvm.dx.wave.product.i32([[TY]]) #[[#attr:]]
-// CHECK-SPIRV: declare [[TY]] @llvm.spv.wave.product.i32([[TY]]) #[[#attr:]]
-
-// CHECK-LABEL: test_uint64_t
-uint64_t test_uint64_t(uint64_t expr) {
-  // CHECK-SPIRV:  %[[RET:.*]] = call spir_func [[TY:.*]] 
@llvm.spv.wave.product.i64([[TY]] %[[#]])
-  // CHECK-DXIL:  %[[RET:.*]] = call [[TY:.*]] 
@llvm.dx.wave.uproduct.i64([[TY]] %[[#]])
-  // CHECK:  ret [[TY]] %[[RET]]
-  return WaveActiveProduct(expr);
-}
-
-// CHECK-DXIL: declare [[TY]] @llvm.dx.wave.uproduct.i64([[TY]]) #[[#attr:]]
-// CHECK-SPIRV: declare [[TY]] @llvm.spv.wave.product.i64([[TY]]) #[[#attr:]]
-
-// Test basic lowering to runtime function call with array and float value.
-
-// CHECK-LABEL: test_floatv4
-float4 test_floatv4(float4 expr) {
-  // CHECK-SPIRV:  %[[RET1:.*]] = call reassoc nnan ninf nsz arcp afn 
spir_func [[TY1:.*]] @llvm.spv.wave.product.v4f32([[TY1]] %[[#]]
-  // CHECK-DXIL:  %[[RET1:.*]] = call reassoc nnan ninf nsz arcp afn 
[[TY1:.*]] @llvm.dx.wave.product.v4f32([[TY1]] %[[#]])
-  // CHECK:  ret [[TY1]] %[[RET1]]
-  return WaveActiveProduct(expr);
-}
-
-// CHECK-DXIL: declare [[TY1]] @llvm.dx.wave.product.v4f32([[TY1]]) #[[#attr]]
-// CHECK-SPIRV: declare [[TY1]] @llvm.spv.wave.product.v4f32([[TY1]]) 
#[[#attr]]
-
-// CHECK: attributes #[[#attr]] = {{{.*}} convergent {{.*}}}
diff --git a/clang/test/SemaHLSL/BuiltIns/WaveActiveProduct-errors.hlsl 
b/clang/test/SemaHLSL/BuiltIns/WaveActiveProduct-errors.hlsl
deleted file mode 100644
index 43ad02b35fc1c..0000000000000
--- a/clang/test/SemaHLSL/BuiltIns/WaveActiveProduct-errors.hlsl
+++ /dev/null
@@ -1,28 +0,0 @@
-// RUN: %clang_cc1 -finclude-default-header -triple 
dxil-pc-shadermodel6.6-library %s -emit-llvm-only -disable-llvm-passes -verify
-
-int test_too_few_arg() {
-  return __builtin_hlsl_wave_active_product();
-  // expected-error@-1 {{too few arguments to function call, expected 1, have 
0}}
-}
-
-float2 test_too_many_arg(float2 p0) {
-  return __builtin_hlsl_wave_active_product(p0, p0);
-  // expected-error@-1 {{too many arguments to function call, expected 1, have 
2}}
-}
-
-bool test_expr_bool_type_check(bool p0) {
-  return __builtin_hlsl_wave_active_product(p0);
-  // expected-error@-1 {{invalid operand of type 'bool'}}
-}
-
-bool2 test_expr_bool_vec_type_check(bool2 p0) {
-  return __builtin_hlsl_wave_active_product(p0);
-  // expected-error@-1 {{invalid operand of type 'bool2' (aka 'vector<bool, 
2>')}}
-}
-
-struct S { float f; };
-
-S test_expr_struct_type_check(S p0) {
-  return __builtin_hlsl_wave_active_product(p0);
-  // expected-error@-1 {{invalid operand of type 'S' where a scalar or vector 
is required}}
-}
diff --git a/llvm/include/llvm/IR/IntrinsicsDirectX.td 
b/llvm/include/llvm/IR/IntrinsicsDirectX.td
index 7caf839c3a50b..909482d72aa88 100644
--- a/llvm/include/llvm/IR/IntrinsicsDirectX.td
+++ b/llvm/include/llvm/IR/IntrinsicsDirectX.td
@@ -223,8 +223,6 @@ def int_dx_wave_reduce_min : 
DefaultAttrsIntrinsic<[llvm_any_ty], [LLVMMatchType
 def int_dx_wave_reduce_umin : DefaultAttrsIntrinsic<[llvm_anyint_ty], 
[LLVMMatchType<0>], [IntrConvergent, IntrNoMem]>;
 def int_dx_wave_reduce_sum : DefaultAttrsIntrinsic<[llvm_any_ty], 
[LLVMMatchType<0>], [IntrConvergent, IntrNoMem]>;
 def int_dx_wave_reduce_usum : DefaultAttrsIntrinsic<[llvm_anyint_ty], 
[LLVMMatchType<0>], [IntrConvergent, IntrNoMem]>;
-def int_dx_wave_product : DefaultAttrsIntrinsic<[llvm_any_ty], 
[LLVMMatchType<0>], [IntrConvergent, IntrNoMem]>;
-def int_dx_wave_uproduct : DefaultAttrsIntrinsic<[llvm_anyint_ty], 
[LLVMMatchType<0>], [IntrConvergent, IntrNoMem]>;
 def int_dx_wave_is_first_lane : DefaultAttrsIntrinsic<[llvm_i1_ty], [], 
[IntrConvergent]>;
 def int_dx_wave_readlane : DefaultAttrsIntrinsic<[llvm_any_ty], 
[LLVMMatchType<0>, llvm_i32_ty], [IntrConvergent, IntrNoMem]>;
 def int_dx_wave_get_lane_count
diff --git a/llvm/include/llvm/IR/IntrinsicsSPIRV.td 
b/llvm/include/llvm/IR/IntrinsicsSPIRV.td
index f9f587f647078..77f49ae721ad5 100644
--- a/llvm/include/llvm/IR/IntrinsicsSPIRV.td
+++ b/llvm/include/llvm/IR/IntrinsicsSPIRV.td
@@ -129,7 +129,6 @@ def int_spv_rsqrt : 
DefaultAttrsIntrinsic<[LLVMMatchType<0>], [llvm_anyfloat_ty]
   def int_spv_wave_reduce_min : DefaultAttrsIntrinsic<[llvm_any_ty], 
[LLVMMatchType<0>], [IntrConvergent, IntrNoMem]>;
   def int_spv_wave_reduce_umin : DefaultAttrsIntrinsic<[llvm_any_ty], 
[LLVMMatchType<0>], [IntrConvergent, IntrNoMem]>;
   def int_spv_wave_reduce_sum : DefaultAttrsIntrinsic<[llvm_any_ty], 
[LLVMMatchType<0>], [IntrConvergent, IntrNoMem]>;
-  def int_spv_wave_product : DefaultAttrsIntrinsic<[llvm_any_ty], 
[LLVMMatchType<0>], [IntrConvergent, IntrNoMem]>;
   def int_spv_wave_is_first_lane : DefaultAttrsIntrinsic<[llvm_i1_ty], [], 
[IntrConvergent]>;
   def int_spv_wave_readlane : DefaultAttrsIntrinsic<[llvm_any_ty], 
[LLVMMatchType<0>, llvm_i32_ty], [IntrConvergent, IntrNoMem]>;
   def int_spv_wave_get_lane_count
diff --git a/llvm/lib/Target/DirectX/DXIL.td b/llvm/lib/Target/DirectX/DXIL.td
index 8cdfea3cb80c8..59a5b7fe4d508 100644
--- a/llvm/lib/Target/DirectX/DXIL.td
+++ b/llvm/lib/Target/DirectX/DXIL.td
@@ -1093,16 +1093,6 @@ def WaveActiveOp : DXILOp<119, waveActiveOp> {
                    IntrinArgIndex<0>, IntrinArgI8<WaveOpKind_Sum>,
                    IntrinArgI8<SignedOpKind_Unsigned>
                  ]>,
-    IntrinSelect<int_dx_wave_product,
-                 [
-                   IntrinArgIndex<0>, IntrinArgI8<WaveOpKind_Product>,
-                   IntrinArgI8<SignedOpKind_Signed>
-                 ]>,
-    IntrinSelect<int_dx_wave_uproduct,
-                 [
-                   IntrinArgIndex<0>, IntrinArgI8<WaveOpKind_Product>,
-                   IntrinArgI8<SignedOpKind_Unsigned>
-                 ]>,
     IntrinSelect<int_dx_wave_reduce_max,
                  [
                    IntrinArgIndex<0>, IntrinArgI8<WaveOpKind_Max>,
diff --git a/llvm/lib/Target/DirectX/DXILShaderFlags.cpp 
b/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
index 77ba95dfb0fe3..52993ee1c1220 100644
--- a/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
+++ b/llvm/lib/Target/DirectX/DXILShaderFlags.cpp
@@ -93,8 +93,6 @@ static bool checkWaveOps(Intrinsic::ID IID) {
   // Wave Active Op Variants
   case Intrinsic::dx_wave_reduce_sum:
   case Intrinsic::dx_wave_reduce_usum:
-  case Intrinsic::dx_wave_product:
-  case Intrinsic::dx_wave_uproduct:
   case Intrinsic::dx_wave_reduce_max:
   case Intrinsic::dx_wave_reduce_umax:
   case Intrinsic::dx_wave_reduce_min:
diff --git a/llvm/lib/Target/DirectX/DirectXTargetTransformInfo.cpp 
b/llvm/lib/Target/DirectX/DirectXTargetTransformInfo.cpp
index 3c5bc471acd7f..8018b09c9f248 100644
--- a/llvm/lib/Target/DirectX/DirectXTargetTransformInfo.cpp
+++ b/llvm/lib/Target/DirectX/DirectXTargetTransformInfo.cpp
@@ -61,13 +61,11 @@ bool DirectXTTIImpl::isTargetIntrinsicTriviallyScalarizable(
   case Intrinsic::dx_wave_reduce_max:
   case Intrinsic::dx_wave_reduce_min:
   case Intrinsic::dx_wave_reduce_sum:
-  case Intrinsic::dx_wave_product:
   case Intrinsic::dx_wave_prefix_sum:
   case Intrinsic::dx_wave_prefix_product:
   case Intrinsic::dx_wave_reduce_umax:
   case Intrinsic::dx_wave_reduce_umin:
   case Intrinsic::dx_wave_reduce_usum:
-  case Intrinsic::dx_wave_uproduct:
   ...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/182741
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to