This patch adds llvm.freeze & processes undef constants from LLVM IR.
syntax:
LLVM IR
<result> = freeze ty <val>
MLIR LLVM Dialect
llvm.freeze val attr-dict : type
Example:
LLVM IR: %3 = freeze i32 5
MLIR: %6 = llvm.freeze %5 : !llvm.i32
Paths
| Differential D75329
[MLIR] Added llvm.freeze ClosedPublic Authored by Sagar on Feb 27 2020, 10:51 PM.
Details
Summary This patch adds llvm.freeze & processes undef constants from LLVM IR. syntax: MLIR LLVM Dialect Example:
Diff Detail
Event TimelineComment Actions Can you document the semantics somewhere? (I have no idea if other patches have done anything like this, but it does seem like something that should be documented somewhere). Comment Actions Looks good, I mostly have nits.
In general, we should just refer to the relevant piece of LLVM's LangRef unless MLIR modeling has different semantics than LLVM IR (which we should avoid as much as possible).
This revision now requires changes to proceed.Feb 28 2020, 1:16 AM This revision is now accepted and ready to land.Feb 28 2020, 6:18 AM Comment Actions I do not have write access to the repository. If would be great if someone could commit for me. Comment Actions This is my Github account, https://github.com/Sagox Closed by commit rGd85821dfa623: [MLIR] Added llvm.freeze (authored by Sagar, committed by ftynse). · Explain WhyMar 2 2020, 1:31 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 247569 mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
mlir/test/Dialect/LLVMIR/roundtrip.mlir
mlir/test/Target/import.ll
mlir/test/Target/llvmir.mlir
|
Nit: could you keep these ordered in the same way as LLVM's LangRef?