[Mlir-commits] [mlir] [mlir] Added new attributes to the llvm.call op in llvmir target (PR #99663)
Tobias Gysi
llvmlistbot at llvm.org
Mon Jul 22 09:05:17 PDT 2024
================
@@ -219,6 +219,27 @@ convertOperationImpl(Operation &opInst, llvm::IRBuilderBase &builder,
}
call->setCallingConv(convertCConvToLLVM(callOp.getCConv()));
call->setTailCallKind(convertTailCallKindToLLVM(callOp.getTailCallKind()));
+ if (callOp.getConvergentAttr())
+ call->addFnAttr(llvm::Attribute::Convergent);
+ if (callOp.getNoUnwindAttr())
+ call->addFnAttr(llvm::Attribute::NoUnwind);
+ if (callOp.getWillReturnAttr())
+ call->addFnAttr(llvm::Attribute::WillReturn);
+
+ // memory effects
+ if (MemoryEffectsAttr memAttr = callOp.getMemoryAttr()) {
+ llvm::MemoryEffects newMemEffects =
+ llvm::MemoryEffects(llvm::MemoryEffects::Location::ArgMem,
+ convertModRefInfoToLLVM(memAttr.getArgMem())) |
+ llvm::MemoryEffects(
+ llvm::MemoryEffects::Location::InaccessibleMem,
+ convertModRefInfoToLLVM(memAttr.getInaccessibleMem())) |
+ llvm::MemoryEffects(llvm::MemoryEffects::Location::Other,
+ convertModRefInfoToLLVM(memAttr.getOther()));
+
----------------
gysit wrote:
```suggestion
```
nit:
https://github.com/llvm/llvm-project/pull/99663
More information about the Mlir-commits
mailing list