[PATCH] Fix icmp lowering

Paweł Bylica chfast at gmail.com
Tue May 19 05:10:02 PDT 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:1727
@@ -1726,2 +1726,3 @@
         NewC = NewC.lshr(ShiftBits);
-        if (ShiftBits && isLegalICmpImmediate(NewC.getSExtValue())) {
+        if (ShiftBits && NewC.getMinSignedBits() <= 64 &&
+          isLegalICmpImmediate(NewC.getSExtValue())) {
----------------
hfinkel wrote:
> Why 64? Shouldn't this depend on the size of the type?
This check is needed to later `NewC.getSExtValue()` be always correct. isLegalICmpImmediate checks the real value.

================
Comment at: test/CodeGen/Generic/icmp-illegal.ll:4
@@ +3,3 @@
+
+; CHECK-LABEL: test_ult
+define i1 @test_ult(i256 %a) nounwind {
----------------
hfinkel wrote:
> What is this test testing? Did these crash previously?
> 
Previously that caused an assert failure in `NewC.getSExtValue()`.

http://reviews.llvm.org/D9147

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list