-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[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
[SIL] Updated instruction worklist. #27028
Conversation
@swift-ci please test |
aaf9d8d
to
b30798c
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.
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!
b30798c
to
a0313a0
Compare
@swift-ci please test |
1 similar comment
@swift-ci please test |
a0313a0
to
150f9a8
Compare
@swift-ci please test and merge |
@swift-ci please ASAN test |
1 similar comment
@swift-ci please ASAN test |
@swift-ci please clean ASAN test |
1 similar comment
@swift-ci please clean ASAN test |
@swift-ci please clean test |
1 similar comment
@swift-ci please clean test |
@swift-ci please ASAN test |
150f9a8
to
beea86d
Compare
@swift-ci please ASAN test |
@swift-ci please test |
1 similar comment
@swift-ci please test |
@swift-ci please ASAN test |
4 similar comments
@swift-ci please ASAN test |
@swift-ci please ASAN test |
@swift-ci please ASAN test |
@swift-ci please ASAN test |
@swift-ci please ASAN test |
worklistMap.erase(instruction); | ||
return instruction; | ||
SILInstruction *pop_back_val() { | ||
return worklist.pop_back_val().getValueOr(nullptr); |
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.
I really like how you are bridging the two APIs here!
beea86d
to
1481373
Compare
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 . |
@swift-ci please test |
1 similar comment
@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.
1481373
to
d2270b9
Compare
@swift-ci please test and merge |
1 similar comment
@swift-ci please test and merge |
BlotSetVector
); that provided a significant deduplication since a sizeable portion of the worklist's implementation was in vector and map management now provided by theBlotSetVector
.ValueBase
with usages ofSILValue
.zap
toresetChecked
.Added a bit of functionality to
BlotSetVector
, specifically to supportSILInstructionWorklist
:insert
return not just the index that the potentially-inserted item is at on return but additionally whether an insertion occurred, matching the behavior ofllvm::DenseMap::insert
.BlotSetVector::reserve
.BlotSetVector::clear
.llvm::SmallVector
.