Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add entrypoint for optimizer #263

Merged
merged 13 commits into from
May 6, 2020
Merged

Conversation

lightszero
Copy link
Member

close #246
still working on it.

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

@lightszero
Copy link
Member Author

@ShawnYun test this when you have time.

}

addrConvertTable = null;
// 10 iterations max
Copy link
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
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
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
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
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
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
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
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
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 shargon and Tommo-L May 2, 2020 16:28
@lightszero
Copy link
Member Author

lightszero commented May 6, 2020

@Tommo-L @shargon can we merge this?

@Tommo-L
Copy link
Contributor

Tommo-L commented May 6, 2020

Waiting for me, I'm reviewing this pr.

@@ -13,24 +13,29 @@ public OptimizeParserAttribute(Type type)
}
}

public enum OptimizeParserType : byte
[Flags]
public enum OptimizeParserType
Copy link
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
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
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?

@@ -10,33 +10,29 @@ public class NefOptimizer
/// <summary>
/// Instructions
/// </summary>
private List<INefItem> Items;
//private List<INefItem> Items;
Copy link
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
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
Contributor

ShawnYun commented May 6, 2020

I think it is good.

@shargon shargon mentioned this pull request May 6, 2020
Copy link
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
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