[Mlir-commits] [mlir] [MLIR] Add attributes no_unwind and will_return to the LLVMIR dialect (PR #98921)

Victor Perez llvmlistbot at llvm.org
Mon Jul 15 10:42:33 PDT 2024


================
@@ -1438,6 +1438,10 @@ static void convertFunctionAttributes(LLVMFuncOp func,
     llvmFunc->addFnAttr(llvm::Attribute::OptimizeNone);
   if (func.getConvergentAttr())
     llvmFunc->addFnAttr(llvm::Attribute::Convergent);
+  if (func.getNoUnwind())
+    llvmFunc->addFnAttr(llvm::Attribute::NoUnwind);
+  if (func.getWillReturn())
+    llvmFunc->addFnAttr(llvm::Attribute::WillReturn);
----------------
victor-eds wrote:

```suggestion
  if (func.getNoUnwindAttr())
    llvmFunc->addFnAttr(llvm::Attribute::NoUnwind);
  if (func.getWillReturnAttr())
    llvmFunc->addFnAttr(llvm::Attribute::WillReturn);
```
Minor for consistency with other attributes. Equivalent. `getNoUnwind` calls `getNoUnwindAttr`.

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


More information about the Mlir-commits mailing list