Justin Bogner da17ced11b
[DirectX] Use scalar arguments for @llvm.dx.dot intrinsics (#134570)
The `dx.dot2`, `dot3`, and `dot4` intrinsics exist purely to lower
`dx.fdot`, and they map exactly to the DXIL ops of the same name. Using
vectors for their arguments adds unnecessary complexity and causes us to
have vector operations that are not trivial to lower post-scalarizer.

Similarly, the `dx.dot2add` intrinsic is overly generic for something
that only needs to lower to a single `dot2AddHalf` DXIL op. Update its
signature to match the operation it lowers to.

Fixes #134569.
2025-04-14 10:34:15 -07:00

15 lines
723 B
LLVM

; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
; DXIL operation dot4 does not support double overload type
; CHECK: in function dot_double4
; CHECK-SAME: Cannot create Dot4 operation: Invalid overload type
define noundef double @dot_double4(double noundef %a1, double noundef %a2,
double noundef %a3, double noundef %a4,
double noundef %b1, double noundef %b2,
double noundef %b3, double noundef %b4) {
entry:
%dx.dot = call double @llvm.dx.dot4(double %a1, double %a2, double %a3, double %a4, double %b1, double %b2, double %b3, double %b4)
ret double %dx.dot
}