Fix icmp lowering
authorPawel Bylica <chfast@gmail.com>
Wed, 20 May 2015 17:21:09 +0000 (17:21 +0000)
committerPawel Bylica <chfast@gmail.com>
Wed, 20 May 2015 17:21:09 +0000 (17:21 +0000)
commit12f6308247582b36ad8ddf0cdba9b9a7829620e7
treed6abb05cacf0a4963e92357e3263c16a6c0a3492
parent9584e07a9cf5261011e70951a3e6286d54643bb1
Fix icmp lowering

Summary:
During icmp lowering it can happen that a constant value can be larger than expected (see the code around the change).
APInt::getMinSignedBits() must be checked again as the shift before can change the constant sign to positive.
I'm not sure it is the best fix possible though.

Test Plan: Regression test included.

Reviewers: resistor, chandlerc, spatel, hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, llvm-commits

Differential Revision: http://reviews.llvm.org/D9147

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237812 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/TargetLowering.cpp
test/CodeGen/Generic/icmp-illegal.ll [new file with mode: 0644]