[llvm-branch-commits] [mlir] [llvm] [OpenMPIRBuilder][MLIR] Pass target-cpu and target-features to outlined functions (PR #80283)

Dominik Adamski via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Feb 1 04:45:20 PST 2024


================
@@ -679,6 +679,15 @@ void OpenMPIRBuilder::finalize(Function *Fn) {
 
     Function *OutlinedFn = Extractor.extractCodeRegion(CEAC);
 
+    // Forward target-cpu, target-features attributes to the outlined function.
+    if (auto Attr = OuterFn->getFnAttribute("target-cpu");
+        Attr.isStringAttribute())
----------------
DominikAdamski wrote:

Nit:
```
auto CpuAttr  = OuterFn->getFnAttribute("target-cpu");
if (CpuAttr.isStringAttribute()) 
```

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


More information about the llvm-branch-commits mailing list