]> granicus.if.org Git - llvm/commit
Merging r293629:
authorHans Wennborg <hans@hanshq.net>
Tue, 31 Jan 2017 18:33:00 +0000 (18:33 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 31 Jan 2017 18:33:00 +0000 (18:33 +0000)
commit6609175de16d00c59f11b358e96675933acfa8bf
treea91195e2e27dd142c62646ef863618edc931a7a9
parent7fbc479dcc79c8340574f7ffc16d38b8b9a3143b
Merging r293629:
------------------------------------------------------------------------
r293629 | sbaranga | 2017-01-31 06:04:15 -0800 (Tue, 31 Jan 2017) | 15 lines

[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/branches/release_40@293669 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCompares.cpp
test/Transforms/InstCombine/indexed-gep-compares.ll