As featured in LLVM Weekly, https://reviews.llvm.org/rL344629 introduces @llvm.sadd.sat for saturating signed integer addition. Not sure whether it's as transparent to the optimizer yet as open-coding it based on checked_add (as we currently do), but we might want to try it when we update to an LLVM version that has that intrinsic available.
As featured in LLVM Weekly, https://reviews.llvm.org/rL344629 introduces
@llvm.sadd.satfor saturating signed integer addition. Not sure whether it's as transparent to the optimizer yet as open-coding it based onchecked_add(as we currently do), but we might want to try it when we update to an LLVM version that has that intrinsic available.