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

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 3 19:50:52 PDT 2024


================
@@ -461,6 +487,33 @@ 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);
+
+      if (Arg0->getType()->isVectorTy()) {
+        return make_error<StringError>(
+            "splitdouble doesn't support lowering vector types.",
----------------
farzonl wrote:

DXILOpLowering already has an error when  it encounters a vector. Putting this in here like this just makes  it so we have to change splitdouble implementation code to get everything working when the scalarization PR lands. What I recomend is to create a correct  Vector test case and XFAIL it. 

Then when scalarization of Struct vectors  lands that test will go from XFAIL to pass and we will know we can remove XFAIL or better yet integrate those tests with  splitdouble.ll

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


More information about the cfe-commits mailing list