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:
John McCall
2018-12-10 15:34:06 -05:00
parent 4d7542c235
commit 2ba7090fe8
61 changed files with 1706 additions and 1441 deletions

View File

@@ -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());
}