Skip to content

Add entrypoint for optimizer#263

Merged
lightszero merged 13 commits intomasterfrom
Branch_lights_optimizer_entrypoint
May 6, 2020
Merged

Add entrypoint for optimizer#263
lightszero merged 13 commits intomasterfrom
Branch_lights_optimizer_entrypoint

Conversation

@lightszero
Copy link
Copy Markdown
Member

close #246
still working on it.

1.修正不恰当的枚举使用方式
2.增加EntryPoint[] 数组,传递到优化器
3.处理不恰当的多遍优化外循环

@lightszero
Copy link
Copy Markdown
Member Author

@ShawnYun test this when you have time.

}

addrConvertTable = null;
// 10 iterations max
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lightszero we need to execute it multiple times, this logic was moved ?

Copy link
Copy Markdown
Member Author

@lightszero lightszero May 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a parser should do loops in itself ,I moved this to Parser_DeleteUselessEqual.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it's better to do it outside, because one optimizer, could optimize the next one.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if that happens need to redesign optimizer parser pipeline. make sure one pass can finish the job.

Copy link
Copy Markdown
Member

@shargon shargon May 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Push1
JMP test
test:
push01
drop
drop

this require two repetitions in order to return an empty script

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like this we need change parser to make sure that can be done by single parser.

Copy link
Copy Markdown
Member Author

@lightszero lightszero May 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can revert this loop part first and discuss this in other issue later.
make this pr is only for abi multi entrypoint

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it's easier with multiple pass

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related #266

@lightszero lightszero requested review from Tommo-L and shargon May 2, 2020 16:28
@lightszero
Copy link
Copy Markdown
Member Author

lightszero commented May 6, 2020

@Tommo-L @shargon can we merge this?

@Tommo-L
Copy link
Copy Markdown
Contributor

Tommo-L commented May 6, 2020

Waiting for me, I'm reviewing this pr.


public enum OptimizeParserType : byte
[Flags]
public enum OptimizeParserType
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public enum OptimizeParserType
public enum OptimizeParserFlag

}

addrConvertTable = null;
// 10 iterations max
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related #266

//insert EntryPointLabel
for (var i = 0; i < entryPoints.Length; i++)
{
if (i > 0 && entryPoints[i - 1] == entryPoints[i])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we don't have to do this verification, as the caller should guarantee it?

/// Instructions
/// </summary>
private List<INefItem> Items;
//private List<INefItem> Items;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line we can remove now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erikzhang can you give @Tommo-L permission for this respository.

@ShawnYun
Copy link
Copy Markdown
Contributor

ShawnYun commented May 6, 2020

I think it is good.

@shargon shargon mentioned this pull request May 6, 2020
Copy link
Copy Markdown
Contributor

@Tommo-L Tommo-L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function is okay.

@lightszero lightszero merged commit df21fde into master May 6, 2020
@lightszero lightszero deleted the Branch_lights_optimizer_entrypoint branch May 6, 2020 11:32
Jim8y pushed a commit that referenced this pull request Aug 3, 2025
* 1.修正不恰当的枚举使用方式
2.增加EntryPoint[] 数组,传递到优化器
3.处理不恰当的多遍优化外循环
* 按照EntryPoint 切分Method,分别优化,相互隔离,就不会互相串了
* format code.
* open default delete deadcode tag
* fix ut with deletedeadcode
* Unify lower and upper case
* lowercase
* 搁置争议,促进开发
* 搁置争议,共同开发
* Rename
* Update NefOptimizer.cs
Co-authored-by: Shargon <shargon@gmail.com>
Jim8y pushed a commit that referenced this pull request Aug 18, 2025
* 1.修正不恰当的枚举使用方式
2.增加EntryPoint[] 数组,传递到优化器
3.处理不恰当的多遍优化外循环

* 按照EntryPoint 切分Method,分别优化,相互隔离,就不会互相串了

* format code.

* open default delete deadcode tag

* fix ut with deletedeadcode

* Unify lower and upper case

* lowercase

* 搁置争议,促进开发

* 搁置争议,共同开发

* Rename

* Update NefOptimizer.cs

Co-authored-by: Shargon <shargon@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modify optimizer of Parser_DeleteDeadCode

4 participants