[InstCombine] avoid infinite loop from vector select transforms
authorSanjay Patel <spatel@rotateright.com>
Tue, 25 May 2021 17:08:30 +0000 (13:08 -0400)
committerSanjay Patel <spatel@rotateright.com>
Tue, 25 May 2021 17:28:38 +0000 (13:28 -0400)
commitae1bc9ebf3a07d2b8c93624518f649805deccc3e
tree3246602bfb1ef505564d5db61c222e85761c4e01
parent0bbb502daa9017480d5fe595556a4f4e5adfcb3f
[InstCombine] avoid infinite loop from vector select transforms

The 2nd test is based on the fuzzer example in post-commit
comments of D101191 -
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34661

The 1st test shows that we don't deal with this symmetrically.
We should be able to reduce both examples (possibly in
instsimplify instead of instcombine).
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/select.ll