This is branched from the D40390.
According to the llvm ir specification insertelement with out of bounds index is undef. This change implements this rule for the InstSimplify. It's mostly valuable as a way to prevent accidental crashes in various passes which are not expecting such indexes.