mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-20 12:31:40 +00:00
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
This commit is contained in:
parent
bc7d598cc1
commit
d7932ca962
@ -168,7 +168,7 @@ void BranchProbabilityAnalysis::calcPointerHeuristics(BasicBlock *BB) {
|
|||||||
|
|
||||||
Value *Cond = BI->getCondition();
|
Value *Cond = BI->getCondition();
|
||||||
ICmpInst *CI = dyn_cast<ICmpInst>(Cond);
|
ICmpInst *CI = dyn_cast<ICmpInst>(Cond);
|
||||||
if (!CI)
|
if (!CI || !CI->isEquality())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Value *LHS = CI->getOperand(0);
|
Value *LHS = CI->getOperand(0);
|
||||||
@ -185,7 +185,7 @@ void BranchProbabilityAnalysis::calcPointerHeuristics(BasicBlock *BB) {
|
|||||||
// p == 0 -> isProb = false
|
// p == 0 -> isProb = false
|
||||||
// p != q -> isProb = true
|
// p != q -> isProb = true
|
||||||
// p == q -> isProb = false;
|
// p == q -> isProb = false;
|
||||||
bool isProb = !CI->isEquality();
|
bool isProb = CI->getPredicate() == ICmpInst::ICMP_NE;
|
||||||
if (!isProb)
|
if (!isProb)
|
||||||
std::swap(Taken, NonTaken);
|
std::swap(Taken, NonTaken);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user