This patch set is meant to show the key addition of a BitsPerByte member of DataLayout and how this can be used in refactorings to remove magic numbers related to the assumption of 8-bit bytes.
Only a small number of such refactorings are shown, but should convey what they'd look like. An RFC will be sent to the llvm community with a suggestion for a way forward.
That's an expensive division...