mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-20 14:29:27 +00:00
Check all terminators inside loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41821 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
75e3bd5bf2
commit
ba32a5f3cc
@ -379,7 +379,6 @@ void LoopIndexSplit::findSplitCondition() {
|
|||||||
|
|
||||||
SplitInfo SD;
|
SplitInfo SD;
|
||||||
// Check all basic block's terminators.
|
// Check all basic block's terminators.
|
||||||
|
|
||||||
for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
|
for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
BasicBlock *BB = *I;
|
BasicBlock *BB = *I;
|
||||||
@ -395,10 +394,10 @@ void LoopIndexSplit::findSplitCondition() {
|
|||||||
|
|
||||||
ICmpInst *CI = dyn_cast<ICmpInst>(BR->getCondition());
|
ICmpInst *CI = dyn_cast<ICmpInst>(BR->getCondition());
|
||||||
if (!CI || CI == ExitCondition)
|
if (!CI || CI == ExitCondition)
|
||||||
return;
|
continue;
|
||||||
|
|
||||||
if (CI->getPredicate() == ICmpInst::ICMP_NE)
|
if (CI->getPredicate() == ICmpInst::ICMP_NE)
|
||||||
return;
|
continue;
|
||||||
|
|
||||||
// If split condition predicate is GT or GE then first execute
|
// If split condition predicate is GT or GE then first execute
|
||||||
// false branch of split condition.
|
// false branch of split condition.
|
||||||
@ -508,7 +507,7 @@ bool LoopIndexSplit::processOneIterationLoop(SplitInfo &SD) {
|
|||||||
// SplitCondition : icmp eq i32 IndVar, SplitValue
|
// SplitCondition : icmp eq i32 IndVar, SplitValue
|
||||||
// into
|
// into
|
||||||
// c1 = icmp uge i32 SplitValue, StartValue
|
// c1 = icmp uge i32 SplitValue, StartValue
|
||||||
// c2 = icmp ult i32 vSplitValue, ExitValue
|
// c2 = icmp ult i32 SplitValue, ExitValue
|
||||||
// and i32 c1, c2
|
// and i32 c1, c2
|
||||||
bool SignedPredicate = ExitCondition->isSignedPredicate();
|
bool SignedPredicate = ExitCondition->isSignedPredicate();
|
||||||
Instruction *C1 = new ICmpInst(SignedPredicate ?
|
Instruction *C1 = new ICmpInst(SignedPredicate ?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user