It's not undefined behavior for an unsigned left shift to overflow (i.e. to
shift bits out), but it has been the source of bugs and exploits in certain
codebases in the past. As we do in other parts of UBSan, this patch adds a
dynamic checker which acts beyond UBSan and checks other sources of errors. The
option is enabled as part of -fsanitize=integer.
The flag is named: -fsanitize=unsigned-shift-base
This matches shift-base and shift-exponent flags.
rdar://problem/46129047
Why is this so complicated? Shouldn't this just be: https://alive2.llvm.org/ce/z/scTqfX
which will then be migrated to use @llvm.ushl.with.overflow once it's there.