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){
|
||||
|
||||
initLoopData();
|
||||
Function *F = loopHeader->getParent();
|
||||
|
||||
// If LoopSimplify was unable to form a preheader, don't do any unswitching.
|
||||
if (!loopPreheader)
|
||||
return false;
|
||||
|
||||
Function *F = loopHeader->getParent();
|
||||
|
||||
// If the condition is trivial, always unswitch. There is no code growth for
|
||||
// this case.
|
||||
if (!IsTrivialUnswitchCondition(LoopCond)) {
|
||||
|
|
Loading…
Reference in New Issue