[InstCombine] Fix constant-folding of overflowing arithmetic ops on vectors
authorLemonBoy <thatlemon@gmail.com>
Mon, 9 Nov 2020 11:39:34 +0000 (14:39 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Mon, 9 Nov 2020 11:41:07 +0000 (14:41 +0300)
commit42732d33cc7f11f585517cc86205da8bcc38fa4e
tree1b38d26abdfa02363a06352956cb08b19ce046c1
parentf4f256fb7b7e6a7dcf64dc9f3f38ea9bd7a8f4ab
[InstCombine] Fix constant-folding of overflowing arithmetic ops on vectors

Feeding vector values to `InstCombiner::OptimizeOverflowCheck` produces a scalar boolean flag if it proves the overflow check can be eliminated.
This causes `InstCombiner::CreateOverflowTuple` to crash as it correctly expects a vector of i1 values instead.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D89628
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/with_overflow.ll