@@ -717,292 +717,4 @@ def Sol_ContractOp : Sol_Op<"contract", [Symbol, SymbolTable, SingleBlock,
717717 let assemblyFormat = "$sym_name $bodyRegion attr-dict";
718718}
719719
720- //
721- // TODO? Move the rest of the ops to the yul dialect?
722- //
723-
724- def Sol_UpdFreePtrOp : Sol_Op<"upd_free_ptr"> {
725- let arguments = (ins I256:$size);
726- let results = (outs I256:$out);
727- let assemblyFormat = "$size attr-dict";
728- }
729-
730- def Sol_ObjectOp : Sol_Op<"object", [Symbol, SymbolTable, NoTerminator,
731- IsolatedFromAbove]> {
732- let arguments = (ins SymbolNameAttr:$sym_name);
733- let regions = (region AnyRegion:$body);
734-
735- let builders = [
736- OpBuilder<(ins CArg<"StringRef", "{}">:$name),[{
737- $_state.addRegion()->emplaceBlock();
738- $_state.addAttribute(getSymNameAttrName($_state.name),
739- $_builder.getStringAttr(name));
740- }]>
741- ];
742- let skipDefaultBuilders = 1;
743-
744- let extraClassDeclaration = [{
745- Block *getEntryBlock() { return &getBody().front(); }
746- }];
747-
748- let assemblyFormat = "$sym_name $body attr-dict";
749- }
750-
751- //
752- // We could auto-generate the following evm builtin ops from
753- // evmasm::InstructionInfo. But I don't think it's worth the effort.
754- //
755-
756- def Sol_CallerOp : Sol_Op<"caller", [Pure]> {
757- let summary = "Represents the `caller` call in yul";
758- let results = (outs I256:$out);
759- let assemblyFormat = "attr-dict";
760- }
761-
762- def Sol_GasOp : Sol_Op<"gas", [Pure]> {
763- let summary = "Represents the `gas` call in yul";
764- let results = (outs I256:$out);
765- let assemblyFormat = "attr-dict";
766- }
767-
768- def Sol_AddressOp : Sol_Op<"address", [Pure]> {
769- let summary = "Represents the `address` call in yul";
770- let results = (outs I256:$out);
771- let assemblyFormat = "attr-dict";
772- }
773-
774- def Sol_BuiltinCallOp : Sol_Op<"builtin_call"> {
775- let summary = "Represents the `call` call in yul";
776- let arguments = (ins I256:$gas, I256:$address, I256:$value, I256:$inpOffset,
777- I256:$inpSize, I256:$outOffset, I256:$outSize);
778- let results = (outs I256:$status);
779- let assemblyFormat = [{
780- $gas `,` $address `,` $value `,` $inpOffset `,` $inpSize `,` $outOffset `,`
781- $outSize attr-dict
782- }];
783- }
784-
785- def Sol_StaticCallOp : Sol_Op<"static_call"> {
786- let summary = "Represents the `staticcall` call in yul";
787- let arguments = (ins I256:$gas, I256:$address, I256:$inpOffset,
788- I256:$inpSize, I256:$outOffset, I256:$outSize);
789- let results = (outs I256:$out);
790- let assemblyFormat = [{
791- $gas `,` $address `,` $inpOffset `,` $inpSize `,` $outOffset `,`
792- $outSize attr-dict
793- }];
794- }
795-
796- def Sol_DelegateCallOp : Sol_Op<"delegate_call"> {
797- let summary = "Represents the `delegatecall` call in yul";
798- let arguments = (ins I256:$gas, I256:$address, I256:$inpOffset,
799- I256:$inpSize, I256:$outOffset, I256:$outSize);
800- let results = (outs I256:$out);
801- let assemblyFormat = [{
802- $gas `,` $address `,` $inpOffset `,` $inpSize `,` $outOffset `,`
803- $outSize attr-dict
804- }];
805- }
806-
807- def Sol_BuiltinRetOp : Sol_Op<"builtin_ret"> {
808- let summary = "Represents the `return` call in yul";
809- let arguments = (ins I256:$addr, I256:$size);
810- let assemblyFormat = "$addr `,` $size attr-dict";
811- }
812-
813- def Sol_RevertOp : Sol_Op<"revert"> {
814- let summary = "Represents the `revert` call in yul";
815- // TODO: Support revert strings.
816- let arguments = (ins I256:$addr, I256:$size);
817- let assemblyFormat = "$addr `,` $size attr-dict";
818- }
819-
820- def Sol_StopOp : Sol_Op<"stop"> {
821- let summary = "Represents the `stop` call in yul";
822- let assemblyFormat = "attr-dict";
823- }
824-
825- def Sol_MLoadOp : Sol_Op<"mload"> {
826- let summary = "Represents the `mload` call in yul";
827- let arguments = (ins I256:$addr);
828- let results = (outs I256:$out);
829- let assemblyFormat = "$addr attr-dict";
830- }
831-
832- def Sol_MStoreOp : Sol_Op<"mstore"> {
833- let summary = "Represents the `mstore` call in yul";
834- let arguments = (ins I256:$addr, I256:$val);
835- let assemblyFormat = "$addr `,` $val attr-dict";
836- }
837-
838- def Sol_MStore8Op : Sol_Op<"mstore8"> {
839- let summary = "Represents the `mstore8` call in yul";
840- let arguments = (ins I256:$addr, I256:$val);
841- let assemblyFormat = "$addr `,` $val attr-dict";
842- }
843-
844- def Sol_ByteOp : Sol_Op<"byte"> {
845- let summary = "Represents the `byte` call in yul";
846- let arguments = (ins I256:$idx, I256:$val);
847- let results = (outs I256:$out);
848- let assemblyFormat = "$idx `,` $val attr-dict";
849- }
850-
851- def Sol_MCopyOp : Sol_Op<"mcopy"> {
852- let summary = "Represents the `mcopy` call in yul";
853- let arguments = (ins I256:$dst, I256:$src, I256:$size);
854- let assemblyFormat = "$dst `,` $src `,` $size attr-dict";
855- }
856-
857- def Sol_MSizeOp : Sol_Op<"msize", [Pure]> {
858- let summary = "Represents the `msize` call in yul";
859- let results = (outs I256:$out);
860- let assemblyFormat = "attr-dict";
861- }
862-
863- def Sol_CallValOp : Sol_Op<"callvalue", [Pure]> {
864- let summary = "Represents the `callvalue` call in yul";
865- let results = (outs I256:$out);
866- let assemblyFormat = "attr-dict";
867- }
868-
869- def Sol_CallDataLoadOp : Sol_Op<"calldataload"> {
870- let summary = "Represents the `calldataload` call in yul";
871- let arguments = (ins I256:$addr);
872- let results = (outs I256:$out);
873- let assemblyFormat = "$addr attr-dict";
874- }
875-
876- def Sol_CallDataSizeOp : Sol_Op<"calldatasize", [Pure]> {
877- let summary = "Represents the `calldatasize` call in yul";
878- let results = (outs I256:$out);
879- let assemblyFormat = "attr-dict";
880- }
881-
882- def Sol_CallDataCopyOp : Sol_Op<"calldatacopy"> {
883- let summary = "Represents the `calldatacopy` call in yul";
884- let arguments = (ins I256:$dst, I256:$src, I256:$size);
885- let assemblyFormat = "$dst `,` $src `,` $size attr-dict";
886- }
887-
888- def Sol_ReturnDataSizeOp : Sol_Op<"returndatasize", [Pure]> {
889- let summary = "Represents the `returndatasize` call in yul";
890- let results = (outs I256:$out);
891- let assemblyFormat = "attr-dict";
892- }
893-
894- def Sol_ReturnDataCopyOp : Sol_Op<"returndatacopy"> {
895- let summary = "Represents the `returndatacopy` call in yul";
896- let arguments = (ins I256:$dst, I256:$src, I256:$size);
897- let assemblyFormat = "$dst `,` $src `,` $size attr-dict";
898- }
899-
900- def Sol_SLoadOp : Sol_Op<"sload"> {
901- let summary = "Represents the `sload` call in yul";
902- let arguments = (ins I256:$addr);
903- let results = (outs I256:$out);
904- let assemblyFormat = "$addr attr-dict";
905- }
906-
907- def Sol_SStoreOp : Sol_Op<"sstore"> {
908- let summary = "Represents the `sstore` call in yul";
909- let arguments = (ins I256:$addr, I256:$val);
910- let assemblyFormat = "$addr `,` $val attr-dict";
911- }
912-
913- // TODO: Support symbolic references to objects outside the current symbol table
914- // (including ones outside the translation unit) using SymbolRefAttr instead of
915- // FlatSymbolRefAttr
916-
917- def Sol_DataOffsetOp : Sol_Op<"dataoffset", [Pure]> {
918- let summary = "Represents the `dataoffset` call in yul";
919- let arguments = (ins FlatSymbolRefAttr:$obj);
920- let results = (outs I256:$out);
921- let assemblyFormat = "attr-dict";
922- }
923-
924- def Sol_DataSizeOp : Sol_Op<"datasize", [Pure]> {
925- let summary = "Represents the `datasize` call in yul";
926- let arguments = (ins FlatSymbolRefAttr:$obj);
927- let results = (outs I256:$out);
928- let assemblyFormat = "attr-dict";
929- }
930-
931- def Sol_CodeSizeOp : Sol_Op<"codesize", [Pure]> {
932- let summary = "Represents the `codesize` call in yul";
933- let results = (outs I256:$out);
934- let assemblyFormat = "attr-dict";
935- }
936-
937- def Sol_CodeCopyOp : Sol_Op<"codecopy"> {
938- let summary = "Represents the `codecopy` call in yul";
939- let arguments = (ins I256:$dst, I256:$src, I256:$size);
940- let assemblyFormat = "$dst `,` $src `,` $size attr-dict";
941- }
942-
943- def Sol_ExtCodeSizeOp : Sol_Op<"extcodesize", [Pure]> {
944- let summary = "Represents the `extcodesize` call in yul";
945- let arguments = (ins I256:$addr);
946- let results = (outs I256:$out);
947- let assemblyFormat = "$addr attr-dict";
948- }
949-
950- def Sol_CreateOp : Sol_Op<"create"> {
951- let summary = "Represents the `create` call in yul";
952- let arguments = (ins I256:$val, I256:$addr, I256:$size);
953- let results = (outs I256:$out);
954- let assemblyFormat = "$val `,` $addr `,` $size attr-dict";
955- }
956-
957- def Sol_Create2Op : Sol_Op<"create2"> {
958- let summary = "Represents the `create2` call in yul";
959- let arguments = (ins I256:$val, I256:$addr, I256:$size, I256:$salt);
960- let results = (outs I256:$out);
961- let assemblyFormat = "$val `,` $addr `,` $size `,` $salt attr-dict";
962- }
963-
964- // TODO: Is this `ConstantLike`? Adding it causes "expected ConstantLike op to
965- // be foldable" assert fail (probably due to the missing let hasFolder = 1).
966- def Sol_MemGuardOp : Sol_Op<"memoryguard", [Pure]> {
967- let summary = "Represents the `memoryguard` call in yul";
968- let arguments = (ins I256Attr:$size);
969- let results = (outs I256:$out);
970- let assemblyFormat = "$size attr-dict";
971- }
972-
973- def Sol_Keccak256Op : Sol_Op<"keccak256"> {
974- // Note that the keccak256 yul builtin has side effects.
975- let summary = "Represents the `keccak256` call in yul";
976- let arguments = (ins I256:$addr, I256:$size);
977- let results = (outs I256:$out);
978- let assemblyFormat = "$addr `,` $size attr-dict";
979- }
980-
981- def Sol_LogOp : Sol_Op<"log"> {
982- let summary = "Represents the `log*` calls in yul";
983- let arguments = (ins I256:$addr, I256:$size, Variadic<I256>:$topics);
984- // FIXME: Trailing spaces with empty $topics.
985- let assemblyFormat = "$addr `,` $size oilist(`topics` `(` $topics `)` ) attr-dict";
986- }
987-
988- def Sol_SetImmutableOp : Sol_Op<"setimmutable"> {
989- let summary = "Represents the `setimmutable` call in yul";
990- let arguments = (ins I256:$addr, StrAttr:$name, I256:$val);
991- let assemblyFormat = "$addr `,` $name `,` $val attr-dict";
992- }
993-
994- def Sol_LoadImmutable2Op : Sol_Op<"loadimmutable"> {
995- let summary = "Represents the `loadimmutable` call in yul";
996- let arguments = (ins StrAttr:$name);
997- let results = (outs I256:$out);
998- let assemblyFormat = "$name attr-dict";
999- }
1000-
1001- def Sol_LinkerSymbolOp : Sol_Op<"linkersymbol"> {
1002- let summary = "Represents the `linkersymbol` call in yul";
1003- let arguments = (ins StrAttr:$name);
1004- let results = (outs I256:$out);
1005- let assemblyFormat = "$name attr-dict";
1006- }
1007-
1008720#endif // MLIR_SOL_SOLOPS_TD
0 commit comments