forked from OSchip/llvm-project
Dereference loopHeader after checking for null rather than before.
llvm-svn: 90990
This commit is contained in:
parent
2262909b20
commit
72c367fb52
|
@ -404,12 +404,13 @@ bool LoopUnswitch::IsTrivialUnswitchCondition(Value *Cond, Constant **Val,
|
||||||
bool LoopUnswitch::UnswitchIfProfitable(Value *LoopCond, Constant *Val){
|
bool LoopUnswitch::UnswitchIfProfitable(Value *LoopCond, Constant *Val){
|
||||||
|
|
||||||
initLoopData();
|
initLoopData();
|
||||||
Function *F = loopHeader->getParent();
|
|
||||||
|
|
||||||
// If LoopSimplify was unable to form a preheader, don't do any unswitching.
|
// If LoopSimplify was unable to form a preheader, don't do any unswitching.
|
||||||
if (!loopPreheader)
|
if (!loopPreheader)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Function *F = loopHeader->getParent();
|
||||||
|
|
||||||
// If the condition is trivial, always unswitch. There is no code growth for
|
// If the condition is trivial, always unswitch. There is no code growth for
|
||||||
// this case.
|
// this case.
|
||||||
if (!IsTrivialUnswitchCondition(LoopCond)) {
|
if (!IsTrivialUnswitchCondition(LoopCond)) {
|
||||||
|
|
Loading…
Reference in New Issue