[InstCombine] Support vectors in SimplifyAddWithRemainder.
authorFlorian Hahn <flo@fhahn.com>
Tue, 10 Mar 2020 14:22:19 +0000 (14:22 +0000)
committerFlorian Hahn <flo@fhahn.com>
Tue, 10 Mar 2020 14:29:40 +0000 (14:29 +0000)
commitc8c14d979abc417d24081cc96c46a2844ce192c2
tree6e91076237dce4d698b877ee7c66b48107df95ae
parent714466bf367dfd5062e1850179d27c37a9ec6b46
[InstCombine] Support vectors in SimplifyAddWithRemainder.

SimplifyAddWithRemainder currently also matches for vector types, but
tries to create an integer constant, which causes a crash.

By using Constant::getIntegerValue() we can support both the scalar and
vector cases.

The 2 added test cases crash without the fix.

Reviewers: spatel, lebedev.ri

Reviewed By: spatel, lebedev.ri

Differential Revision: https://reviews.llvm.org/D75906
llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
llvm/test/Transforms/InstCombine/add4.ll