Skip to content

Commit 6c1c962

Browse files
committed
addressed pr commments
1 parent 1f963ab commit 6c1c962

File tree

3 files changed

+4
-31
lines changed

3 files changed

+4
-31
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3630,18 +3630,10 @@ X86TargetLowering::getJumpConditionMergingParams(Instruction::BinaryOps Opc,
36303630
// (unless CCMP is available). OR+EQ cannot be optimized via bitwise ops,
36313631
// unlike OR+NE which becomes (P|Q)!=0. Similarly, don't split signed
36323632
// comparisons (SLT, SGT) that can be optimized.
3633-
if (BaseCost >= 0 && !Subtarget.hasCCMP() && Opc == Instruction::Or) {
3634-
auto *LCmp = dyn_cast<ICmpInst>(Lhs);
3635-
auto *RCmp = dyn_cast<ICmpInst>(Rhs);
3636-
if (LCmp && RCmp) {
3637-
ICmpInst::Predicate LPred = LCmp->getPredicate();
3638-
ICmpInst::Predicate RPred = RCmp->getPredicate();
3639-
// Split OR+EQ patterns as they don't have clever optimizations
3640-
if (LPred == ICmpInst::ICMP_EQ && RPred == ICmpInst::ICMP_EQ) {
3641-
return {-1, -1, -1};
3642-
}
3643-
}
3644-
}
3633+
if (BaseCost >= 0 && !Subtarget.hasCCMP() && Opc == Instruction::Or &&
3634+
match(Lhs, m_SpecificICmp(ICmpInst::ICMP_EQ, m_Value(), m_Value())) &&
3635+
match(Rhs, m_SpecificICmp(ICmpInst::ICMP_EQ, m_Value(), m_Value())))
3636+
return {-1, -1, -1};
36453637

36463638
return {BaseCost, BrMergingLikelyBias.getValue(),
36473639
BrMergingUnlikelyBias.getValue()};

llvm/test/CodeGen/X86/issue-160612.c

Lines changed: 0 additions & 19 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)