Giter Club home page Giter Club logo

Comments (10)

woxjro avatar woxjro commented on July 30, 2024
  • レジスタと即値を分離
    • store
    • getelementptr
    • icmp
    • Register::is_const を削除
    • 上のが全部終わったら,stack_initializationをmichelson-astで書き換える
      => 7% ほど性能向上

from lltz.

woxjro avatar woxjro commented on July 30, 2024
  • fn compilemichelson_codeVec<MInstructionWrapper> にする.
    これで michelson-ast への書き換えは完了(のはず).

from lltz.

woxjro avatar woxjro commented on July 30, 2024
  • a110d96 michelson-ast の format を改善

from lltz.

woxjro avatar woxjro commented on July 30, 2024

最適化 (nishidaさん案)

  • ヒープ領域で,型ごとにメモリカウンタを持たせているが,ヒープ領域全体で1つのメモリカウンタを共有するように変更
    • complex_smartcontract.rs で 10% ほどの性能向上が見込める.(1978 -> 1747 命令になる見込み)

from lltz.

woxjro avatar woxjro commented on July 30, 2024
  • @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.

woxjro avatar woxjro commented on July 30, 2024
  • register2stack_ptr.len() + memory_ptr をいい感じにしたい.
    • 今後,レジスタ領域・ヒープ領域の設計が変わる可能性があるので,レジスタ・ヒープの位置を取得する箇所を設計変更に強いものへと変更したい

from lltz.

woxjro avatar woxjro commented on July 30, 2024
  • 「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.

woxjro avatar woxjro commented on July 30, 2024
  • C/C++ -> Clang AST -> Michelson MLIR Dialect -> Michelson を考えている
  • Clang AST をいじる前に,Michelson DSLtoy言語を参考に実装するのが吉?
  • Michelson MLIR Dialect -> Michelson の部分はMLIR Dialect を Json ダンプする.?

from lltz.

woxjro avatar woxjro commented on July 30, 2024

命令数計測

0b189c5

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.

woxjro avatar woxjro commented on July 30, 2024

ソース言語を MLIR へと変更したため,この Issue は close

from lltz.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.