]> granicus.if.org Git - llvm/commit
[InstCombine] Make sure that LHS and RHS have the same type in
authorSilviu Baranga <silviu.baranga@arm.com>
Tue, 31 Jan 2017 14:04:15 +0000 (14:04 +0000)
committerSilviu Baranga <silviu.baranga@arm.com>
Tue, 31 Jan 2017 14:04:15 +0000 (14:04 +0000)
commit150da15398989cf659f9ae9010c72bb0c4721215
tree0807a81752501377a19f4ddea0934415215dcc6a
parent438897d8deb61cfd39e6e5d0c789e7b86afd68c2
[InstCombine] Make sure that LHS and RHS have the same type in
transformToIndexedCompare

If they don't have the same type, the size of the constant
index would need to be adjusted (and this wouldn't be always
possible).

Alternatively we could try the analysis with the initial
RHS value, which would guarantee that the two sides have
the same type. However it is unlikely that in practice this
would pass our transformation requirements.

Fixes PR31808 (https://llvm.org/bugs/show_bug.cgi?id=31808).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293629 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCompares.cpp
test/Transforms/InstCombine/indexed-gep-compares.ll