mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
Dereference loopHeader after checking for null rather than before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90990 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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)) {
|
||||||
|
Reference in New Issue
Block a user