Skip to content

Add/fix comments as a follow-up to the string constants optimization changes. #17057

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

Merged
merged 1 commit into from
Jun 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/SILOptimizer/PassManager/PassPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ static void addClosureSpecializePassPipeline(SILPassPipelinePlan &P) {
P.addDeadObjectElimination();

// These few passes are needed to cleanup between loop unrolling and GlobalOpt.
// This is needed to fully optimize static small String constants.
P.addSimplifyCFG();
P.addSILCombine();
P.addPerformanceConstantPropagation();
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/SILCombiner/SILCombinerMiscVisitors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ static SILValue isConstIndexAddr(SILValue val, unsigned &index) {
auto *Index = dyn_cast<IntegerLiteralInst>(IA->getIndex());

// Limiting to 32 bits is more than enough. The reason why not limiting to 64
// bits is to let room for overflow when we add two indices.
// bits is to leave room for overflow when we add two indices.
if (!Index || Index->getValue().getActiveBits() > 32)
return nullptr;

Expand Down