[llvm] [Scalarizer][DirectX] support structs return types (PR #111569)
Tex Riddell via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 17 16:27:02 PDT 2024
================
@@ -0,0 +1,45 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -passes='function(scalarizer)' -S -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
+
+define void @test_vector_double_split_void(<2 x double> noundef %d) {
+; CHECK-LABEL: define void @test_vector_double_split_void(
+; CHECK-SAME: <2 x double> noundef [[D:%.*]]) {
+; CHECK-NEXT: [[D_I0:%.*]] = extractelement <2 x double> [[D]], i64 0
+; CHECK-NEXT: [[HLSL_ASUINT_I0:%.*]] = call { i32, i32 } @llvm.dx.splitdouble.i32(double [[D_I0]])
+; CHECK-NEXT: [[D_I1:%.*]] = extractelement <2 x double> [[D]], i64 1
+; CHECK-NEXT: [[HLSL_ASUINT_I1:%.*]] = call { i32, i32 } @llvm.dx.splitdouble.i32(double [[D_I1]])
+; CHECK-NEXT: ret void
+;
+ %hlsl.asuint = call { <2 x i32>, <2 x i32> } @llvm.dx.splitdouble.v2i32(<2 x double> %d)
----------------
tex3d wrote:
Other than the fact that we need something to differentiate vector forms of this intrinsic, I don't think the i32 part is a meaningful overload component of this intrinsic. It could only ever be two i32 return values and one double input per scalar operation. I suppose this is just a rhetorical comment, since I can't think of a cleaner way to do it for now.
https://github.com/llvm/llvm-project/pull/111569
More information about the llvm-commits
mailing list