Conversation
b3452f3 to
a71f64b
Compare
|
|
||
| // Compute variable dependencies. | ||
| if (checkSameConst(m_variableList, dependencies)) { | ||
| while (changed) { |
There was a problem hiding this comment.
This could be a do-while, isn't it?
There was a problem hiding this comment.
Got it. I'll do it.
|
Could you explain what this patch tries to do? What are the immediate sources? |
Actually, walrus's Phase 2 of buildVariable() is quite inefficient. May can be takes n^2 to find dependency of instructions. So I tried some chop-off the check range that algorithm does loops. It generate candidates, and do lookup for in that range. |
|
For a label and a stack slot, the immediate sources are what each branch into that label leaves in that slot. |
a71f64b to
446ca05
Compare
| std::vector<VariableRef> slotValue(dependencySize, static_cast<VariableRef>(DependencyGenContext::kNoRef)); | ||
| std::vector<size_t> slotRangeStart(dependencySize, static_cast<size_t>(VariableList::kRangeMax)); | ||
| std::vector<size_t> slotRangeEnd(dependencySize, 0); | ||
| std::vector<uint8_t> slotConstraints(dependencySize, 0); |
There was a problem hiding this comment.
My impression is that these vectors are part of a structure. Can we use less number of vectors which contain a struct member? Something like:
struct SlotData {
rangeStart;
rangeEnd;
constraints;
};
std::vector slotData;
This could reduce the memory allocations.
446ca05 to
6092898
Compare
|
I can't understand why only the armt2 debug is always failing. It can be sperate issue. |
|
This is the test: test/regression/segv_onExport.wasm |
|
Weird. That test file looks just okay. |
Some project had a similar problem with python in this issue: apache/arrow#46343 You can just ammend your patch without any changes, push again to force the CI to run and it should run normally as I have seen. It does not cause a problem every time and its mainly with the arm platforms in my experience. It might be a qemu error, I am unsure. |
I think trap is not working correctly in armt2. Seems to problem is memory related. But I still cannot understand why x86/RISC-V is acting like normal. |
Maybe it can be problem of destructor. |
Phase 2 of buildVariables seeks the whole chain for every cell, so it got quadratic on big function.
Now each cell looks at its immediate sources only and we repeat until nothing changes.
30-48% of JIT compile time is taken for this, so it this patch speeds up reorder cycle shows like this.
(I make this patch when doing a test using real-workload jobs in walrus. so this bench is based on real-workloads.)