Skip to content

[SIL] Updated instruction worklist. #27028

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

Conversation

nate-chandler
Copy link
Contributor

  • Replaced usage of raw map and vector with the type that wraps the combination (BlotSetVector); that provided a significant deduplication since a sizeable portion of the worklist's implementation was in vector and map management now provided by the BlotSetVector.
  • Replaced usages of bare ValueBase with usages of SILValue.
  • Renamed zap to resetChecked.

Added a bit of functionality to BlotSetVector, specifically to support SILInstructionWorklist:

  • Made insert return not just the index that the potentially-inserted item is at on return but additionally whether an insertion occurred, matching the behavior of llvm::DenseMap::insert.
  • Added a method to reserve capacity in the backing vector and map: BlotSetVector::reserve.
  • Added a method to free extra storage used by the backing vector and map: BlotSetVector::clear.
  • Added size_type typedef matching llvm::SmallVector.

@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler force-pushed the update-instruction-worklist branch from aaf9d8d to b30798c Compare September 4, 2019 21:31
Copy link
Contributor

@gottesmm gottesmm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nate and I talked about this. He is going to make a few more changes that we talked about. I think what he is doing here is great! Big +1 from me!

@nate-chandler nate-chandler force-pushed the update-instruction-worklist branch from b30798c to a0313a0 Compare September 5, 2019 00:19
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler force-pushed the update-instruction-worklist branch from a0313a0 to 150f9a8 Compare September 5, 2019 16:16
@nate-chandler
Copy link
Contributor Author

@swift-ci please test and merge

@nate-chandler
Copy link
Contributor Author

@swift-ci please ASAN test

1 similar comment
@nate-chandler
Copy link
Contributor Author

@swift-ci please ASAN test

@nate-chandler
Copy link
Contributor Author

@swift-ci please clean ASAN test

1 similar comment
@nate-chandler
Copy link
Contributor Author

@swift-ci please clean ASAN test

@nate-chandler
Copy link
Contributor Author

@swift-ci please clean test

1 similar comment
@nate-chandler
Copy link
Contributor Author

@swift-ci please clean test

@nate-chandler
Copy link
Contributor Author

@swift-ci please ASAN test

@nate-chandler
Copy link
Contributor Author

@swift-ci please ASAN test

@nate-chandler
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please ASAN test

4 similar comments
@nate-chandler
Copy link
Contributor Author

@swift-ci please ASAN test

@nate-chandler
Copy link
Contributor Author

@swift-ci please ASAN test

@nate-chandler
Copy link
Contributor Author

@swift-ci please ASAN test

@nate-chandler
Copy link
Contributor Author

@swift-ci please ASAN test

@nate-chandler
Copy link
Contributor Author

@swift-ci please ASAN test

3 similar comments
@nate-chandler
Copy link
Contributor Author

@swift-ci please ASAN test

@nate-chandler
Copy link
Contributor Author

@swift-ci please ASAN test

@nate-chandler
Copy link
Contributor Author

@swift-ci please ASAN test

worklistMap.erase(instruction);
return instruction;
SILInstruction *pop_back_val() {
return worklist.pop_back_val().getValueOr(nullptr);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like how you are bridging the two APIs here!

@nate-chandler nate-chandler force-pushed the update-instruction-worklist branch from beea86d to 1481373 Compare September 6, 2019 15:48
@nate-chandler
Copy link
Contributor Author

The assertion failure from SmallDenseMap ( https://ci.swift.org/job/swift-PR-osx/15765/console ) look to be fixed in an unlanded LLVM patch: https://reviews.llvm.org/D56455 .

@nate-chandler
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

- Replaced usage of raw map and vector with the type that wraps the
  combination (BlotSetVector); that provided a significant deduplication
  since a sizeable portion of the worklist's implementation was in
  vector and map management now provided by the BlotSetVector.
- Templated over the type of map and vector used by the blot set vector.
- Added SmallSILInstructionWorklist where the map and vector are
  specified to be SmallDenseMap and SmallVector respectively.
- Replaced usages of bare ValueBase with usages of SILValue.
- Renamed zap to resetChecked.

Added a bit of functionality to BlotSetVector, specifically to support
SILInstructionWorklist:

- Made insert return not just the index that the potentially-inserted
  item is at on return but additionally whether an insertion occurred,
  matching the behavior of llvm::DenseMap::insert.
- Added a method to reserve capacity in the backing vector and map:
  BlotSetVector::reserve.
- Added a method to free extra storage used by the backing vector and
  map: BlotSetVector::clear.
- Modified SmallBlotSetVector's template parameters so that only a value
  and size can be specified--that type will always use SmallVector and
  SmallDenseMap for its superclass' VectorT and MapT template
  parameters.
- Updated variable names.
@nate-chandler nate-chandler force-pushed the update-instruction-worklist branch from 1481373 to d2270b9 Compare September 6, 2019 16:10
@nate-chandler
Copy link
Contributor Author

@swift-ci please test and merge

1 similar comment
@nate-chandler
Copy link
Contributor Author

@swift-ci please test and merge

@swift-ci swift-ci merged commit 902da31 into swiftlang:master Sep 6, 2019
@nate-chandler nate-chandler deleted the update-instruction-worklist branch July 5, 2023 23:39
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.

4 participants