mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +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();
|
||||
ICmpInst *CI = dyn_cast<ICmpInst>(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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user