From: Jakub Staszak Date: Fri, 15 Jul 2011 20:51:06 +0000 (+0000) Subject: Fix pointer heuristic. Check whether predicator is ICMP_NE instead of if it is X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d7932ca9627cdd9f913a37ee51f410819aa83cf3;p=oota-llvm.git Fix pointer heuristic. Check whether predicator is ICMP_NE instead of if it is not isEquality(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135296 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/BranchProbabilityInfo.cpp b/lib/Analysis/BranchProbabilityInfo.cpp index 15059c733ab..609279f1171 100644 --- a/lib/Analysis/BranchProbabilityInfo.cpp +++ b/lib/Analysis/BranchProbabilityInfo.cpp @@ -168,7 +168,7 @@ void BranchProbabilityAnalysis::calcPointerHeuristics(BasicBlock *BB) { Value *Cond = BI->getCondition(); ICmpInst *CI = dyn_cast(Cond); - if (!CI) + if (!CI || !CI->isEquality()) return; Value *LHS = CI->getOperand(0); @@ -185,7 +185,7 @@ void BranchProbabilityAnalysis::calcPointerHeuristics(BasicBlock *BB) { // p == 0 -> isProb = false // p != q -> isProb = true // p == q -> isProb = false; - bool isProb = !CI->isEquality(); + bool isProb = CI->getPredicate() == ICmpInst::ICMP_NE; if (!isProb) std::swap(Taken, NonTaken);