[llvm] [CodeExtractor][OpenMP] Allow to specify address space for aggregate arguments structure (PR #66998)

Dominik Adamski via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 01:51:19 PDT 2023


================
@@ -114,6 +114,11 @@ class CodeExtractorAnalysisCache {
     // label, if non-empty, otherwise "extracted".
     std::string Suffix;
 
+    // Optional value of alloca address space which should be used for
+    // allocation of structure which aggregates arguments. If empty, default
+    // alloca address space for given data layout is used.
----------------
DominikAdamski wrote:

Code Extractor allocates struct for aggregate arguments. The alloca instruction is created in line 1186:
```
 Struct = new AllocaInst(
        StructArgTy, DL.getAllocaAddrSpace(), nullptr, "structArg",
        StructArgTy,
        /* My change - specify address space */
        AggregateArgsAllocaAddrSpace.value_or(DL.getAllocaAddrSpace()), nullptr,
        "structArg",
 ```
 The type of alloca is used to determine the type of pointer argument of the outlined function. Changes in CodeExtractor line 870:
 ```
    ParamTy.push_back(PointerType::get(
        StructTy,
        AggregateArgsAllocaAddrSpace.value_or(DL.getAllocaAddrSpace())));
  }
  ```

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


More information about the llvm-commits mailing list