[clang] [llvm] Adding splitdouble HLSL function (PR #109331)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 15:20:57 PDT 2024


================
@@ -461,6 +479,27 @@ class OpLowerer {
     });
   }
 
+  [[nodiscard]] bool lowerSplitDouble(Function &F) {
+    IRBuilder<> &IRB = OpBuilder.getIRB();
+    return replaceFunction(F, [&](CallInst *CI) -> Error {
+      IRB.SetInsertPoint(CI);
+
+      Value *Arg0 = CI->getArgOperand(0);
+
+      Type *NewRetTy = OpBuilder.getResSplitDoubleType(M.getContext());
+
+      std::array<Value *, 1> Args{Arg0};
+      Expected<CallInst *> OpCall = OpBuilder.tryCreateOp(
----------------
farzonl wrote:

could you explain how this line and DXIL.td  work together? You are `specifying `OpCode::SplitDouble` in the createOp and on line 531 you are mapping the `Intrinsic::dx_splitdouble:` intrinsic  to this lowering behavior. Does that mean DXIL.td isn't used at all?

https://github.com/llvm/llvm-project/pull/109331


More information about the cfe-commits mailing list