From: Dan Gohman Date: Fri, 4 Jun 2010 23:16:05 +0000 (+0000) Subject: Don't track users of undef values; they aren't interesting for X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=a15ec5dfccace52bcfb31733e0412801a1ae3915;p=oota-llvm.git Don't track users of undef values; they aren't interesting for register pressure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105501 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 86ea3eb6cdb..94df9557608 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -2095,8 +2095,12 @@ LSRInstance::CollectLoopInvariantFixupsAndFormulae() { } else if (const SCEVUnknown *U = dyn_cast(S)) { if (!Inserted.insert(U)) continue; const Value *V = U->getValue(); - if (const Instruction *Inst = dyn_cast(V)) + if (const Instruction *Inst = dyn_cast(V)) { + // Look for instructions defined outside the loop. if (L->contains(Inst)) continue; + } else if (isa(V)) + // Undef doesn't have a live range, so it doesn't matter. + continue; for (Value::const_use_iterator UI = V->use_begin(), UE = V->use_end(); UI != UE; ++UI) { const Instruction *UserInst = dyn_cast(*UI);