For non-mem-intrinsic and non-lifetime CallBases, the current
isRemovable function only checks if the CallBase 1. has no uses 2.
will return 3. does not throw:
https://github.com/llvm/llvm-project/blob/80fb7823367c1d105fcbc8f21b69205a0d68c859/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp#L1017
But we should also exclude invokes even in case they don't throw,
because they are terminators and thus cannot be removed. While it
doesn't seem to make much sense for invokes to have an nounwind
target, this kind of code can be generated and is also valid bitcode.
I'd probably go for a CB->isTerminator() check here, rather than checking specifically for invokes (though i doubt this can happen with callbr in practice).