The functions 'add' and 'shift' in LLVM have different behaviors and can't be safely substituted. Undef in LLVM can be replaced with various values, but the replacement should be a subset of the original value set. Undefined behavior in an IR is not necessarily related to source-level undefined behavior.
Sort: