This is in preparation for https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179. As part of that change, we'll want to invoke some of these constant folding APIs explicitly, as it won't happen as part of ConstantExpr::getXYZ() anymore.
Ideally, we'd merge these with the DL-aware constant folding APIs and only call those, but this is not easily possible for some current usages (most important IRBuilder, which uses DL-independent constant folding by default, and some major layering changes would be needed to change that).
This is basically a reboot of D115035 with different motivation.