[InstCombine] fix crash on type mismatch with fcmp fold
authorSanjay Patel <spatel@rotateright.com>
Thu, 1 Sep 2022 12:32:06 +0000 (08:32 -0400)
committerSanjay Patel <spatel@rotateright.com>
Thu, 1 Sep 2022 12:57:55 +0000 (08:57 -0400)
commitc3d1504d6316c11164e5edb9415e6fb43bb705f3
tree22b4d5d0cf94d6cac4496960ed854be9f61e2870
parentaddbdac5d580eee25146e4a8fda62fa18e6b945d
[InstCombine] fix crash on type mismatch with fcmp fold

The existing predicate doesn't work for a single-element
vector, so make sure we are not crossing scalar/vector types.

Test (was crashing) based on the post-commit example for:
482777123427
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/fcmp.ll