mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-14 05:42:45 +00:00
Fix bugs, don't do external methods which causes segv.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1414 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4b770a3145
commit
3bf915f2a2
@ -127,7 +127,8 @@ static bool TransformLoop(cfg::LoopInfo *Loops, cfg::Loop *Loop) {
|
||||
#ifdef DEBUG
|
||||
cerr << IndVars[i];
|
||||
#endif
|
||||
if (IV != Cannonical) { // Don't modify the cannonical indvar
|
||||
// Don't modify the cannonical indvar or unrecognized indvars...
|
||||
if (IV != Cannonical && IV->InductionType != InductionVariable::Unknown) {
|
||||
Instruction *Val = IterCount;
|
||||
if (!isa<ConstantInt>(IV->Step) || // If the step != 1
|
||||
!cast<ConstantInt>(IV->Step)->equalsInt(1)) {
|
||||
@ -183,6 +184,8 @@ static bool TransformLoop(cfg::LoopInfo *Loops, cfg::Loop *Loop) {
|
||||
}
|
||||
|
||||
bool InductionVariableSimplify::doit(Method *M) {
|
||||
if (M->isExternal()) return false;
|
||||
|
||||
// Figure out the loop structure of the method...
|
||||
cfg::LoopInfo Loops(M);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user