Skip to content

[DirectX] change makedouble return type to overloadTy #141156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2025

Conversation

spall
Copy link
Contributor

@spall spall commented May 22, 2025

Change makedouble return type to overloadTy so makedouble will match validator expectations
Closes #140998

@llvmbot
Copy link
Member

llvmbot commented May 22, 2025

@llvm/pr-subscribers-backend-directx

Author: Sarah Spall (spall)

Changes

Change makedouble return type to overloadTy so makedouble will match validator expectations
Closes #140998


Full diff: https://github.com/llvm/llvm-project/pull/141156.diff

2 Files Affected:

  • (modified) llvm/lib/Target/DirectX/DXIL.td (+2-1)
  • (modified) llvm/test/CodeGen/DirectX/asdouble.ll (+4-4)
diff --git a/llvm/lib/Target/DirectX/DXIL.td b/llvm/lib/Target/DirectX/DXIL.td
index fd4f90c8a7fd4..492e0784cedd0 100644
--- a/llvm/lib/Target/DirectX/DXIL.td
+++ b/llvm/lib/Target/DirectX/DXIL.td
@@ -965,7 +965,8 @@ def MakeDouble : DXILOp<101, makeDouble> {
   let Doc = "creates a double value";
   let intrinsics = [IntrinSelect<int_dx_asdouble>];
   let arguments = [Int32Ty, Int32Ty];
-  let result = DoubleTy;
+  let result = OverloadTy;
+  let overloads = [Overloads<DXIL1_0, [DoubleTy]>];
   let stages = [Stages<DXIL1_0, [all_stages]>];
   let attributes = [Attributes<DXIL1_0, [ReadNone]>];
 }
diff --git a/llvm/test/CodeGen/DirectX/asdouble.ll b/llvm/test/CodeGen/DirectX/asdouble.ll
index 6a581d69eb7e9..757d5b970bf48 100644
--- a/llvm/test/CodeGen/DirectX/asdouble.ll
+++ b/llvm/test/CodeGen/DirectX/asdouble.ll
@@ -4,7 +4,7 @@
 ; DirectX op
 
 define noundef double @asdouble_scalar(i32 noundef %low, i32 noundef %high) {
-; CHECK: call double @dx.op.makeDouble(i32 101, i32 %low, i32 %high)
+; CHECK: call double @dx.op.makeDouble.f64(i32 101, i32 %low, i32 %high)
   %ret = call double @llvm.dx.asdouble.i32(i32 %low, i32 %high)
   ret double %ret
 }
@@ -12,9 +12,9 @@ define noundef double @asdouble_scalar(i32 noundef %low, i32 noundef %high) {
 declare double @llvm.dx.asdouble.i32(i32, i32)
 
 define noundef <3 x double> @asdouble_vec(<3 x i32> noundef %low, <3 x i32> noundef %high) {
-; CHECK: call double @dx.op.makeDouble(i32 101, i32 %low.i0, i32 %high.i0)
-; CHECK: call double @dx.op.makeDouble(i32 101, i32 %low.i1, i32 %high.i1)
-; CHECK: call double @dx.op.makeDouble(i32 101, i32 %low.i2, i32 %high.i2)
+; CHECK: call double @dx.op.makeDouble.f64(i32 101, i32 %low.i0, i32 %high.i0)
+; CHECK: call double @dx.op.makeDouble.f64(i32 101, i32 %low.i1, i32 %high.i1)
+; CHECK: call double @dx.op.makeDouble.f64(i32 101, i32 %low.i2, i32 %high.i2)
   %ret = call <3 x double> @llvm.dx.asdouble.v3i32(<3 x i32> %low, <3 x i32> %high)
   ret <3 x double> %ret
 }

@spall spall merged commit 1bdec97 into llvm:main May 23, 2025
14 checks passed
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Jun 3, 2025
Change makedouble return type to overloadTy so makedouble will match
validator expectations
Closes llvm#140998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DirectX] MakeDouble doesn't match validator expectations
4 participants