This is for D60460. computeForAddSub() essentially already supports carries because it has to deal with subtractions. This revision extracts a lower-level computeForAddCarry() function, which allows computing the known bits for add (carry known zero), sub (carry known one) and addcarry (carry unknown).
As we don't seem to have any yet, I've added a unit test file for KnownBits and an exhaustive test for the computeForAddCarry functionality.
The signature is already different from computeForAddCarry() (2 bools vs 1 KnownBits),
i don't see the need for Internal suffix.
Also, i believe anonymous namespaces are preferred, so drop static, and wrap into namespace {}.