[InstSimplify] Return poison for out of bounds extractelement
authorNikita Popov <nikita.ppv@gmail.com>
Sun, 3 Jan 2021 17:05:33 +0000 (18:05 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sun, 3 Jan 2021 17:15:58 +0000 (18:15 +0100)
commitc6ad00d709853e378cd70e34e755942f9d6f0c8f
tree5c655d32c9fb2d0fac22438e10a89bd81c4d835b
parent49c2d703d344e8d259a4aee38c8ade1df34bc54a
[InstSimplify] Return poison for out of bounds extractelement

This is the same change as D93990, but for extractelement rather
than insertelement.

> If idx exceeds the length of val for a fixed-length vector, the
> result is a poison value. For a scalable vector, if the value of
> idx exceeds the runtime length of the vector, the result is a
> poison value.
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstCombine/extractelement-inseltpoison.ll
llvm/test/Transforms/InstCombine/extractelement.ll
llvm/test/Transforms/InstSimplify/2011-09-05-InsertExtractValue.ll
llvm/test/Transforms/InstSimplify/extract-element.ll
llvm/test/Transforms/InstSimplify/undef.ll
llvm/test/Transforms/InstSimplify/vscale-inseltpoison.ll
llvm/test/Transforms/InstSimplify/vscale.ll