[PATCH] Fix icmp lowering
hfinkel at anl.gov
hfinkel at anl.gov
Wed May 20 09:27:40 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())) {
----------------
chfast wrote:
> 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.
Sure, but why 64?
================
Comment at: test/CodeGen/Generic/icmp-illegal.ll:4
@@ +3,3 @@
+
+; CHECK-LABEL: test_ult
+define i1 @test_ult(i256 %a) nounwind {
----------------
chfast wrote:
> hfinkel wrote:
> > What is this test testing? Did these crash previously?
> >
> Previously that caused an assert failure in `NewC.getSExtValue()`.
Okay, thanks.
http://reviews.llvm.org/D9147
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list