mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-14 22:07:54 +00:00
Branch folding may invalidate liveness.
Branch folding can use a register scavenger to update liveness information when required. Don't do that if liveness information is already invalid. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153517 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
33fa614b16
commit
80799fbe3c
@ -23,6 +23,7 @@
|
|||||||
#include "llvm/CodeGen/MachineModuleInfo.h"
|
#include "llvm/CodeGen/MachineModuleInfo.h"
|
||||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||||
#include "llvm/CodeGen/MachineJumpTableInfo.h"
|
#include "llvm/CodeGen/MachineJumpTableInfo.h"
|
||||||
|
#include "llvm/CodeGen/MachineRegisterInfo.h"
|
||||||
#include "llvm/CodeGen/RegisterScavenging.h"
|
#include "llvm/CodeGen/RegisterScavenging.h"
|
||||||
#include "llvm/Target/TargetInstrInfo.h"
|
#include "llvm/Target/TargetInstrInfo.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
@ -183,8 +184,14 @@ bool BranchFolder::OptimizeFunction(MachineFunction &MF,
|
|||||||
TII = tii;
|
TII = tii;
|
||||||
TRI = tri;
|
TRI = tri;
|
||||||
MMI = mmi;
|
MMI = mmi;
|
||||||
|
RS = NULL;
|
||||||
|
|
||||||
RS = TRI->requiresRegisterScavenging(MF) ? new RegScavenger() : NULL;
|
// Use a RegScavenger to help update liveness when required.
|
||||||
|
MachineRegisterInfo &MRI = MF.getRegInfo();
|
||||||
|
if (MRI.tracksLiveness() && TRI->requiresRegisterScavenging(MF))
|
||||||
|
RS = new RegScavenger();
|
||||||
|
else
|
||||||
|
MRI.invalidateLiveness();
|
||||||
|
|
||||||
// Fix CFG. The later algorithms expect it to be right.
|
// Fix CFG. The later algorithms expect it to be right.
|
||||||
bool MadeChange = false;
|
bool MadeChange = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user