[clang] [llvm] [HLSL] [DXIL] Implement the AddUint64 HLSL function and the UAddc DXIL op (PR #127137)
Deric Cheung via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 25 14:16:51 PST 2025
Icohedron wrote:
> The SPIRV test case isn't sufficent. Two reasons.
>
> 1. Since you are not using `__builtin_addc ` Your codegen path for `uadd.with.overflow` is custom to HLSL. Your emitter is in `EmitHLSLBuiltinExpr`.
> 2. `llvm/test/CodeGen/SPIRV/llvm-intrinsics/uadd.with.overflow.ll` only tests `spirv32` and `spirv64` targets when HLSL uses the `spirv` target
>
> You can add a `spirv` target to `uadd.with.overflow.ll`. Make sure nothing blows up if we use our target. Second a test case in the hlsl_intrinsics directory is warranted to make sure the custom things you are doing like `CreateShuffleVector` doesn't trigger problems for spirv codegen or for the spirv validator `spirv-val`.
I added `llvm/test/CodeGen/SPIRV/hlsl-intrinsics/AddUint64.ll` to test the lowering of the AddUint64 implementation to SPIRV.
I couldn't add the spirv target to the existing `llvm/test/CodeGen/SPIRV/llvm-intrinsics/uadd.with.overflow.ll` test because doing so results in an error when the test is executed: `error: line 41: Operand 2 of Decorate requires one of these capabilities: Kernel
OpDecorate %a FuncParamAttr Zext`
https://github.com/llvm/llvm-project/pull/127137
More information about the cfe-commits
mailing list