Comments (10)
- レジスタと即値を分離
- store
- getelementptr
- icmp
- Register::is_const を削除
- 上のが全部終わったら,stack_initializationをmichelson-astで書き換える
=> 7% ほど性能向上
from lltz.
-
fn compile
のmichelson_code
をVec<MInstructionWrapper>
にする.
これで michelson-ast への書き換えは完了(のはず).
from lltz.
- a110d96 michelson-ast の format を改善
from lltz.
最適化 (nishidaさん案)
- ヒープ領域で,型ごとにメモリカウンタを持たせているが,ヒープ領域全体で1つのメモリカウンタを共有するように変更
- complex_smartcontract.rs で 10% ほどの性能向上が見込める.(1978 -> 1747 命令になる見込み)
from lltz.
-
@llvm.memcpy
をGEPとstoreの命令で書き換えたい(複数の命令(bitcast
)をまたいでLLTZ IR 変換するのが不自然なため)
%22 = bitcast %struct.Fish* %20 to i8*
%23 = bitcast %struct.Fish* %21 to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(12) %22, i8* nonnull align 4 dereferenceable(12) %23, i64 12, i1 false)
from lltz.
-
register2stack_ptr.len() + memory_ptr
をいい感じにしたい.- 今後,レジスタ領域・ヒープ領域の設計が変わる可能性があるので,レジスタ・ヒープの位置を取得する箇所を設計変更に強いものへと変更したい
from lltz.
- 「LLVM IR は Michelson と比較すると抽象度が低すぎてつらい印象がある」 (PPL'23)
- ソース言語としてMLIR(およびそのDialect)を使えないか?
- MLIR を吐くC/C++ のフロントエンド https://polygeist.mit.edu/
- 量子プログラミングのためのMLIR Dialect https://arxiv.org/abs/2101.11365
- MLIR をソースにする場合,現状どれほどの高級言語でMLIRを吐くフロントエンドがサポートされているか?やされる予定なのか?が気になる
- また,実際に実現可能そうなのか辺りも調査が必要
from lltz.
C/C++
->Clang AST
->Michelson MLIR Dialect
->Michelson
を考えているClang AST
をいじる前に,Michelson DSL
をtoy
言語を参考に実装するのが吉?Michelson MLIR Dialect
->Michelson
の部分はMLIR Dialect を Json ダンプする.?- https://discourse.llvm.org/t/emitting-structured-json-for-mlir-dialect-using-tablegen/2232
- 現状MLIR のJson ダンプはサポートされていない.Dialect固有のDumpなら十分対応可能.?
from lltz.
命令数計測
sh ./utils/count_instructions.sh ./examples/out/*
filename | instruction count | PAIR count | UNPAIR count | CAR count | CDR count | GET count | UPDATE count |
---|---|---|---|---|---|---|---|
./examples/out/complex_smartcontract.tz | 1746 | 137 | 64 | 85 | 0 | 164 | 88 |
./examples/out/simple_add.tz | 314 | 34 | 14 | 7 | 0 | 8 | 15 |
./examples/out/simple_if.tz | 290 | 32 | 13 | 6 | 0 | 7 | 14 |
./examples/out/simple_llvm_memcpy.tz | 758 | 72 | 32 | 26 | 0 | 47 | 45 |
./examples/out/simple_smartcontract.tz | 817 | 73 | 32 | 37 | 0 | 77 | 47 |
./examples/out/simple_while.tz | 369 | 34 | 14 | 11 | 0 | 12 | 15 |
(この表を見ただけでは分からないが生成コードを見ると)引数を挿入する処理が異常に命令数を使っている.simple_while
だと120命令くらい.ここはかなり削れるはず.
- 各フェーズの命令数を知りたい
- michelson-ast に機能追加
from lltz.
ソース言語を MLIR へと変更したため,この Issue は close
from lltz.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lltz.