Conversation
60c4d3c to
cfb7c1d
Compare
33f3d55 to
bd9790e
Compare
akiramenai
left a comment
There was a problem hiding this comment.
LGTM, but I'd prefer @azhogin to look at the patch as well
| const Function &F = MF->getFunction(); | ||
| if (F.hasFnAttribute("tvm_raw_func")) { | ||
| OutStreamer->EmitRawText("\t.internal\t:" + CurrentFnSym->getName()); | ||
| if (Blocks < 16) { |
There was a problem hiding this comment.
Can we avoid the magic number here?
| // | | ||
| // ... | ||
| bool TVMIfConversionTerm::tryConvertIf2(MachineBasicBlock *MBB) { | ||
| MachineBasicBlock *TBB = nullptr; |
There was a problem hiding this comment.
Nitpicking, but TrueBB and FalseBB are easier to understand.
There was a problem hiding this comment.
TBB/FBB are usual names in llvm for true/false destination blocks.
There was a problem hiding this comment.
Well, they are indeed usual. But 'usual' doesn't imply anything on the quality of the choice. Anyway, naming here is up to the author, I merely expressed my opinion.
|
I had an idea to represent function adresses as continuations. And add continuation type to language like slice/builder/cell/tuple. |
|
The idea is surely eligible for the kind of machine you have. Though I'm not sure that LLVM is a right framework for trying to implement the idea. To answer your question: it would be slightly harder, I guess. But does it matter? What is the example of a function address usage in a code of a contract... |
|
What actually bothers me about this approach is a support of high-level control-flow primitives like WHILE, UNTIL, REPEAT... |
|
@mskvortsov you've mentioned that the approach you use in the PR doesn't work well with huge functions (with more than 255 BBs). Do you plan to modify the solution somehow (e.g. use tuples of continuations) or do you want to abandon the idea? |
0f62ed2 to
78931e2
Compare
|
From what I see from performance analysis of a certain C++ sample, a huge number of basic blocks (301 in that code to be precise) looks like a problem by itself. Here is an execution statistics of logically the same C++: Stack manipulation primitives, implicit jmprefs and rets, and literals add roughly 7.5k of gas. My current guess it's because of stack modelling goes nuts on this huge number of BBs. |
No description provided.