[llvm] [DirectX] Legalize memcpy (PR #139173)

Finn Plummer via llvm-commits llvm-commits at lists.llvm.org
Fri May 9 11:56:50 PDT 2025


================
@@ -246,6 +247,59 @@ downcastI64toI32InsertExtractElements(Instruction &I,
   }
 }
 
+static void emitMemcpyExpansion(IRBuilder<> &Builder, Value *Dst, Value *Src,
+                                ConstantInt *Length) {
+
+  uint64_t ByteLength = Length->getZExtValue();
+  if (ByteLength == 0)
+    return;
+
+  LLVMContext &Ctx = Builder.getContext();
+  const DataLayout &DL = Builder.GetInsertBlock()->getModule()->getDataLayout();
+
+  auto GetArrTyFromVal = [](Value *Val) {
----------------
inbelic wrote:

nit:
```suggestion
  auto GetArrTyFromVal = [](Value *Val) -> ArrayType * {
```

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


More information about the llvm-commits mailing list