-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[VPlan] Remove SCEVToExpansion mapping (NFC). #164490
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,8 +32,6 @@ bool vputils::onlyScalarValuesUsed(const VPValue *Def) { | |||||||||||
| } | ||||||||||||
|
|
||||||||||||
| VPValue *vputils::getOrCreateVPValueForSCEVExpr(VPlan &Plan, const SCEV *Expr) { | ||||||||||||
| if (auto *Expanded = Plan.getSCEVExpansion(Expr)) | ||||||||||||
| return Expanded; | ||||||||||||
| VPValue *Expanded = nullptr; | ||||||||||||
| if (auto *E = dyn_cast<SCEVConstant>(Expr)) | ||||||||||||
| Expanded = Plan.getOrAddLiveIn(E->getValue()); | ||||||||||||
|
Comment on lines
35
to
37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can now early-exit here, and below:
Suggested change
|
||||||||||||
|
|
@@ -50,7 +48,6 @@ VPValue *vputils::getOrCreateVPValueForSCEVExpr(VPlan &Plan, const SCEV *Expr) { | |||||||||||
| Plan.getEntry()->appendRecipe(Expanded->getDefiningRecipe()); | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that the previous mapping also took care of caching VPExpandSCEVRecipe's, i.e., if getOrCreateVPValueForSCEVExpr() is called twice for the same EXPR. But such cases should be easy to clean up? Should ExpandedSCEVs be checked if it already has a Value for Expr, before expanding code for it? |
||||||||||||
| } | ||||||||||||
| } | ||||||||||||
| Plan.addSCEVExpansion(Expr, Expanded); | ||||||||||||
| return Expanded; | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
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.
Has this NOTE been taken care of, i.e., all users are modeled in VPlan directly?