File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
libsolidity/codegen/mlir/Sol Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 3232using namespace mlir ;
3333using namespace mlir ::sol;
3434
35+ // ===----------------------------------------------------------------------===//
36+ // ConvCastOp
37+ // ===----------------------------------------------------------------------===//
38+
39+ OpFoldResult ConvCastOp::fold (FoldAdaptor adaptor) { return adaptor.getInp (); }
40+
3541// ===----------------------------------------------------------------------===//
3642// ConstantOp
3743// ===----------------------------------------------------------------------===//
Original file line number Diff line number Diff line change @@ -40,15 +40,17 @@ include "mlir/IR/SymbolInterfaces.td"
4040// specific ops) should verify that their types (ssa argument types and
4141// TypeAttr) are high level ((un)signed int types, sol dialect types etc.).
4242
43- // FIXME: Can we have a custom lowering of unrealized_conversion_cast instead?
44- // ReconcileUnrealizedCasts conversion won't work here.
45- def Sol_ConvCastOp : Sol_Op<"conv_cast"> {
46- let summary = "Like unrealized_conversion_cast; Represents the remapped value";
43+ // TODO: Is using builtin. unrealized_conversion_cast better+faster? Can we
44+ // legalize it without a separate reconcile pass?
45+ def Sol_ConvCastOp : Sol_Op<"conv_cast", [Pure] > {
46+ let summary = "No-op cast that casts to the remapped value in conversion ";
4747
4848 let arguments = (ins AnyType:$inp);
4949 let results = (outs AnyType:$out);
5050
5151 let assemblyFormat = "$inp attr-dict `:` type($inp) `->` type($out)";
52+
53+ let hasFolder = 1;
5254}
5355
5456def Sol_ConstantOp : Op<Sol_Dialect, "constant",
You can’t perform that action at this time.
0 commit comments