mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Remove the extra-inhabitant value witness functions.
This is essentially a long-belated follow-up to Arnold's #12606. The key observation here is that the enum-tag-single-payload witnesses are strictly more powerful than the XI witnesses: you can simulate the XI witnesses by using an extra case count that's <= the XI count. Of course the result is less efficient than the XI witnesses, but that's less important than overall code size, and we can work on fast-paths for that. The extra inhabitant count is stored in a 32-bit field (always present) following the ValueWitnessFlags, which now occupy a fixed 32 bits. This inflates non-XI VWTs on 32-bit targets by a word, but the net effect on XI VWTs is to shrink them by two words, which is likely to be the more important change. Also, being able to access the XI count directly should be a nice win.
This commit is contained in:
@@ -860,6 +860,10 @@ llvm::AttributeList IRGenModule::constructInitialAttributes() {
|
||||
llvm::AttributeList::FunctionIndex, b);
|
||||
}
|
||||
|
||||
llvm::Constant *IRGenModule::getInt32(uint32_t value) {
|
||||
return llvm::ConstantInt::get(Int32Ty, value);
|
||||
}
|
||||
|
||||
llvm::Constant *IRGenModule::getSize(Size size) {
|
||||
return llvm::ConstantInt::get(SizeTy, size.getValue());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user