mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Don't cache the MBB in the class. Its only used by one function. Change a for loop over operands to use unsigned instead of int.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162344 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f7c4d26f77
commit
df8de92083
@ -42,7 +42,6 @@ namespace {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
const TargetInstrInfo *TII; // Machine instruction info.
|
const TargetInstrInfo *TII; // Machine instruction info.
|
||||||
MachineBasicBlock *MBB; // Current basic block
|
|
||||||
|
|
||||||
// Any YMM register live-in to this function?
|
// Any YMM register live-in to this function?
|
||||||
bool FnHasLiveInYmm;
|
bool FnHasLiveInYmm;
|
||||||
@ -122,7 +121,7 @@ static bool checkFnHasLiveInYmm(MachineRegisterInfo &MRI) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool hasYmmReg(MachineInstr *MI) {
|
static bool hasYmmReg(MachineInstr *MI) {
|
||||||
for (int i = 0, e = MI->getNumOperands(); i != e; ++i) {
|
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
|
||||||
const MachineOperand &MO = MI->getOperand(i);
|
const MachineOperand &MO = MI->getOperand(i);
|
||||||
if (!MO.isReg())
|
if (!MO.isReg())
|
||||||
continue;
|
continue;
|
||||||
@ -189,7 +188,6 @@ bool VZeroUpperInserter::processBasicBlock(MachineFunction &MF,
|
|||||||
MachineBasicBlock &BB) {
|
MachineBasicBlock &BB) {
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
unsigned BBNum = BB.getNumber();
|
unsigned BBNum = BB.getNumber();
|
||||||
MBB = &BB;
|
|
||||||
|
|
||||||
// Don't process already solved BBs
|
// Don't process already solved BBs
|
||||||
if (BBSolved[BBNum])
|
if (BBSolved[BBNum])
|
||||||
@ -207,7 +205,7 @@ bool VZeroUpperInserter::processBasicBlock(MachineFunction &MF,
|
|||||||
|
|
||||||
// The entry MBB for the function may set the initial state to dirty if
|
// The entry MBB for the function may set the initial state to dirty if
|
||||||
// the function receives any YMM incoming arguments
|
// the function receives any YMM incoming arguments
|
||||||
if (MBB == MF.begin()) {
|
if (&BB == MF.begin()) {
|
||||||
EntryState = ST_CLEAN;
|
EntryState = ST_CLEAN;
|
||||||
if (FnHasLiveInYmm)
|
if (FnHasLiveInYmm)
|
||||||
EntryState = ST_DIRTY;
|
EntryState = ST_DIRTY;
|
||||||
@ -253,7 +251,7 @@ bool VZeroUpperInserter::processBasicBlock(MachineFunction &MF,
|
|||||||
// When unknown, only compute the information within the block to have
|
// When unknown, only compute the information within the block to have
|
||||||
// it available in the exit if possible, but don't change the block.
|
// it available in the exit if possible, but don't change the block.
|
||||||
if (EntryState != ST_UNKNOWN) {
|
if (EntryState != ST_UNKNOWN) {
|
||||||
BuildMI(*MBB, I, dl, TII->get(X86::VZEROUPPER));
|
BuildMI(BB, I, dl, TII->get(X86::VZEROUPPER));
|
||||||
++NumVZU;
|
++NumVZU;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user