[llvm] [DirectX] Add support for typedBufferLoad and Store for RWBuffer<double2> and RWBuffer<double> (PR #139996)

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Thu May 15 10:01:59 PDT 2025


================
@@ -532,6 +541,80 @@ static Value *expandRadiansIntrinsic(CallInst *Orig) {
   return Builder.CreateFMul(X, PiOver180);
 }
 
+static void expandTypedBufferLoadIntrinsic(CallInst *Orig) {
+  IRBuilder<> Builder(Orig);
+
+  unsigned ExtractNum =
+      Orig->getType()->getStructElementType(0)->isVectorTy() ? 4 : 2;
+  Type *Ty = VectorType::get(Builder.getInt32Ty(), ExtractNum, false);
----------------
farzonl wrote:

I could see a case for all even number cases/ because we could loop the as double ans splitdouble cases. But `<23 x double>` should always be wrong.

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


More information about the llvm-commits mailing list