@@ -1642,15 +1642,14 @@ static bool eliminateConstraints(Function &F, DominatorTree &DT, LoopInfo &LI,
1642
1642
DFSInStack);
1643
1643
}
1644
1644
1645
- LLVM_DEBUG (dbgs () << " Processing " );
1646
-
1647
1645
// For a block, check if any CmpInsts become known based on the current set
1648
1646
// of constraints.
1649
1647
if (CB.isCheck ()) {
1650
1648
Instruction *Inst = CB.getInstructionToSimplify ();
1651
1649
if (!Inst)
1652
1650
continue ;
1653
- LLVM_DEBUG (dbgs () << " condition to simplify: " << *Inst << " \n " );
1651
+ LLVM_DEBUG (dbgs () << " Processing condition to simplify: " << *Inst
1652
+ << " \n " );
1654
1653
if (auto *II = dyn_cast<WithOverflowInst>(Inst)) {
1655
1654
Changed |= tryToSimplifyOverflowMath (II, Info, ToRemove);
1656
1655
} else if (auto *Cmp = dyn_cast<ICmpInst>(Inst)) {
@@ -1669,7 +1668,7 @@ static bool eliminateConstraints(Function &F, DominatorTree &DT, LoopInfo &LI,
1669
1668
}
1670
1669
1671
1670
auto AddFact = [&](CmpInst::Predicate Pred, Value *A, Value *B) {
1672
- LLVM_DEBUG (dbgs () << " fact to add to the system: " ;
1671
+ LLVM_DEBUG (dbgs () << " Processing fact to add to the system: " ;
1673
1672
dumpUnpackedICmp (dbgs (), Pred, A, B); dbgs () << " \n " );
1674
1673
if (Info.getCS (CmpInst::isSigned (Pred)).size () > MaxRows) {
1675
1674
LLVM_DEBUG (
@@ -1718,8 +1717,17 @@ static bool eliminateConstraints(Function &F, DominatorTree &DT, LoopInfo &LI,
1718
1717
A = CB.Cond .Op0 ;
1719
1718
B = CB.Cond .Op1 ;
1720
1719
if (CB.DoesHold .Pred != CmpInst::BAD_ICMP_PREDICATE &&
1721
- !Info.doesHold (CB.DoesHold .Pred , CB.DoesHold .Op0 , CB.DoesHold .Op1 ))
1720
+ !Info.doesHold (CB.DoesHold .Pred , CB.DoesHold .Op0 , CB.DoesHold .Op1 )) {
1721
+ LLVM_DEBUG ({
1722
+ dbgs () << " Not adding fact " ;
1723
+ dumpUnpackedICmp (dbgs (), Pred, A, B);
1724
+ dbgs () << " because precondition " ;
1725
+ dumpUnpackedICmp (dbgs (), CB.DoesHold .Pred , CB.DoesHold .Op0 ,
1726
+ CB.DoesHold .Op1 );
1727
+ dbgs () << " does not hold.\n " ;
1728
+ });
1722
1729
continue ;
1730
+ }
1723
1731
} else {
1724
1732
bool Matched = match (CB.Inst , m_Intrinsic<Intrinsic::assume>(
1725
1733
m_ICmp (Pred, m_Value (A), m_Value (B))));
0 commit comments