Translate align, noalias, noundef, signext and zeroext result
attributes from llvm.func to LLVM IR.
This is needed for https://github.com/llvm/llvm-project/issues/58579
Depends on D137048
Paths
| Differential D137049
[mlir][llvmir] Translate function result attributes to LLVM IR. ClosedPublic Authored by vzakhari on Oct 30 2022, 2:08 PM.
Details Summary Translate align, noalias, noundef, signext and zeroext result This is needed for https://github.com/llvm/llvm-project/issues/58579 Depends on D137048
Diff Detail Event TimelineThis revision is now accepted and ready to land.Nov 2 2022, 6:44 AM
This revision is now accepted and ready to land.Nov 2 2022, 5:41 PM Comment Actions Hi @ftynse, there is some code duplication between verifyRegionArgAttribute and verifyRegionResultAttribute right now. I am going to get rid of it when addressing https://reviews.llvm.org/D137048#inline-1324059 in a separate commit.
vzakhari retitled this revision from [mlir][llvmir] Translate function return attributes to LLVM IR. to [mlir][llvmir] Translate function result attributes to LLVM IR.. Comment ActionsAdded LLVM::isCompatibleType() check to narrow the set of types that we can reliably diagnose in the verification code. ftynse added inline comments.
This revision is now accepted and ready to land.Nov 18 2022, 4:25 AM ftynse added inline comments.
Closed by commit rG29016d2830d4: [mlir][llvmir] Translate function result attributes to LLVM IR. (authored by vzakhari). · Explain WhyNov 18 2022, 12:04 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 473800 mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
mlir/test/Dialect/LLVMIR/func.mlir
mlir/test/Target/LLVMIR/llvmir.mlir
|
It looks like I cannot verify the argument/result type in the verification hooks. For example, there are cases where llvm.align is attached to memref<...> arguments, so it is not clear to me how to verify the value type here without converting the value type to LLVM dialect type. I suggest keeping the attribute's type (UnitAttr, IntegerAttr, etc.) verification here, but keep the value type verification inside LLVM dialect to LLVM IR translator (i.e. ModuleTranslation.cpp). @ftynse, does it sound appropriate to you?