mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-06 03:08:43 +00:00
Swap exit condition operands if it works.
llvm-svn: 41817
This commit is contained in:
parent
9f93ab3579
commit
ce76c29be0
@ -328,14 +328,24 @@ void LoopIndexSplit::findLoopConditionals() {
|
||||
if (!CI)
|
||||
return;
|
||||
|
||||
// FIXME
|
||||
// FIXME
|
||||
if (CI->getPredicate() == ICmpInst::ICMP_EQ
|
||||
|| CI->getPredicate() == ICmpInst::ICMP_NE)
|
||||
return;
|
||||
|
||||
if (CI->getPredicate() == ICmpInst::ICMP_SGT
|
||||
|| CI->getPredicate() == ICmpInst::ICMP_UGT
|
||||
|| CI->getPredicate() == ICmpInst::ICMP_SGE
|
||||
|| CI->getPredicate() == ICmpInst::ICMP_UGE
|
||||
|| CI->getPredicate() == ICmpInst::ICMP_EQ
|
||||
|| CI->getPredicate() == ICmpInst::ICMP_NE)
|
||||
return;
|
||||
|| CI->getPredicate() == ICmpInst::ICMP_UGE) {
|
||||
|
||||
BasicBlock *FirstSuccessor = BR->getSuccessor(0);
|
||||
// splitLoop() is expecting LT/LE as exit condition predicate.
|
||||
// Swap operands here if possible to meet this requirement.
|
||||
if (!L->contains(FirstSuccessor))
|
||||
CI->swapOperands();
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
ExitCondition = CI;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user