This is couple of minor fixes inspired by the llvm-opt-fuzzer. Even though they are not practically important, they come up often during the fuzzing runs and may clobber other issues.
Crashes happen when constant index of some instruction has unreasonable value (i.e out of bounds indexes for insertelement). Even though it's usually undefined behaviour we still can't crash the compiler.
I suspect there might be more of a similar issues, but these are all I have noticed so far.