[Mlir-commits] [mlir] Add support for MLIR to llvm vscale attribute (PR #67012)

Christian Ulmann llvmlistbot at llvm.org
Fri Sep 22 06:42:43 PDT 2023


================
@@ -1610,6 +1611,16 @@ void ModuleImport::processFunctionAttributes(llvm::Function *func,
     funcOp.setArmStreaming(true);
   else if (func->hasFnAttribute("aarch64_pstate_sm_body"))
     funcOp.setArmLocallyStreaming(true);
+  llvm::Attribute attr = func->getFnAttribute(llvm::Attribute::VScaleRange);
+  if (attr.isValid()) {
+    MLIRContext *context = funcOp.getContext();
+    auto intTy = IntegerType::get(context, 32);
+    std::optional<unsigned> maxAttr = attr.getVScaleRangeMax();
+    unsigned maxVal = maxAttr.value_or(0);
----------------
Dinistro wrote:

```suggestion
    unsigned maxVal = attr.getVScaleRangeMax().value_or(0);
```

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


More information about the Mlir-commits mailing list