-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[CodeGen] Add analyses to help for porting GC passes #74972
Conversation
|
b88258c
to
bdb2d91
Compare
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.
Minor drive-by comments so far.
35f739d
to
cb96d32
Compare
cb96d32
to
3315a7d
Compare
This pass is broken and looks like no one uses it for the last 15+ years. ```c++ bool Printer::runOnFunction(Function &F) { if (F.hasGC()) return false; GCFunctionInfo *FD = &getAnalysis<GCModuleInfo>().getFunctionInfo(F); ``` ```c++ GCFunctionInfo &GCModuleInfo::getFunctionInfo(const Function &F) { assert(!F.isDeclaration() && "Can only get GCFunctionInfo for a definition!"); assert(F.hasGC()); // Equivalent to `assert(false);` when called by `Printer::runOnFunction` ``` See also #74972.
ded9ddf
to
1430575
Compare
GCInfoPrinter
to new pass manager
Just remove the |
- `CollectorMetadataAnalysis` provides `GCStrategyMap`. - `GCFunctionAnalysis` provides `GCFunctionInfo`. `GCStrategyMap` owns `GCStrategy` pointers and this pass is used by `AsmPrinter` to iterate all GC strategies. Most passes that require `GCModuleInfo` actually require the `GCFunctionInfo`, so add `GCFunctionAnalysis` for convenience.
1430575
to
04ed65a
Compare
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.
LGTM. Please wait for @arsenm to approve before merging this.
CollectorMetadataAnalysis
providesGCStrategyMap
.GCFunctionAnalysis
providesGCFunctionInfo
.GCStrategyMap
ownsGCStrategy
pointers and thispass is used by
AsmPrinter
to iterate all GC strategies.Most passes that require
GCModuleInfo
actually require theGCFunctionInfo
,so add
GCFunctionAnalysis
for convenience.