Page MenuHomePhabricator

[InstSimplify] make simplifyUnsignedRangeCheck commutative for ZeroICmp
AbandonedPublic

Authored by khei4 on Wed, Mar 15, 11:53 PM.

Details

Summary

on InstSimplify, simplifyUnsignedRangeCheck missed being commutative for inner equality comparison.
related Functional patch: https://reviews.llvm.org/D78430

Depends on https://reviews.llvm.org/D146195

Diff Detail

Event Timeline

khei4 created this revision.Wed, Mar 15, 11:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptWed, Mar 15, 11:53 PM
khei4 requested review of this revision.Wed, Mar 15, 11:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptWed, Mar 15, 11:53 PM
nikic requested changes to this revision.Thu, Mar 16, 1:31 AM

InstCombine canonicalizes constant icmp operands to the RHS, this is why constants are not usually handled on the LHS. Unless there is some PhaseOrdering reason why it is important to handle this pattern prior to the first InstCombine run, we shouldn't do this.

llvm/lib/Analysis/InstructionSimplify.cpp
1564

You can use m_c_ICmp.

This revision now requires changes to proceed.Thu, Mar 16, 1:31 AM
khei4 abandoned this revision.Thu, Mar 16, 1:57 AM

InstCombine canonicalizes constant icmp operands to the RHS, this is why constants are not usually handled on the LHS. Unless there is some PhaseOrdering reason why it is important to handle this pattern prior to the first InstCombine run, we shouldn't do this.

Oh, now I could have found that canonicalization. Thank you!