-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
eliminate redundant inline scanning #5117
Conversation
| FuncDeclaration oldparent = parent; | ||
| parent = fd; | ||
| if (fd.fbody && !fd.naked) | ||
| if (fd.fbody && !fd.naked) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
60241f9 to
550fbd6
Compare
| @@ -393,6 +393,7 @@ enum FUNCFLAGsafetyInprocess = 2; // working on determining safety | |||
| enum FUNCFLAGnothrowInprocess = 4; // working on determining nothrow | |||
| enum FUNCFLAGnogcInprocess = 8; // working on determining @nogc | |||
| enum FUNCFLAGreturnInprocess = 0x10; // working on inferring 'return' for parameters | |||
| enum FUNCFLAGinlineScanned = 0x20; // function has been scanned for inline possibilities | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/inline possibilities/inlining opportunities/ I guess but no matter
|
Looks good to me. |
|
Auto-merge toggled on |
eliminate redundant inline scanning
|
This PR introduced a regression: |
|
I have a question about this change. Q1. To see the inline possibility of a function,
Q2. As I already specified in Q1, recursive expansion is tested and prevented by |
|
Ah, if In other words, a function will be scanned at most three times - 1. as function declaration, 2. as a statement, and 3. as an expression. Before this change, the 2. result is cached to But, as I already said in Q1, the No.1 case == |
While working on a fix to do better delegate inlining, I discovered that the inliner is constantly rescanning functions for inline possibilities. Added a flag
FUNCFLAGinlineScannedto put a stop to that, and a flagagainto enable rescanning in case of delegate parameters.The latter isn't complete yet, but this PR won't hurt.