mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-18 14:31:27 +00:00
Handle register masks in branch folding.
Don't attempt to move instructions with regmask operands. They are most likely calls anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150634 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e746186ed4
commit
a230262791
@ -1477,6 +1477,9 @@ MachineBasicBlock::iterator findHoistingInsertPosAndDeps(MachineBasicBlock *MBB,
|
||||
bool IsDef = false;
|
||||
for (unsigned i = 0, e = PI->getNumOperands(); !IsDef && i != e; ++i) {
|
||||
const MachineOperand &MO = PI->getOperand(i);
|
||||
// If PI has a regmask operand, it is probably a call. Separate away.
|
||||
if (MO.isRegMask())
|
||||
return Loc;
|
||||
if (!MO.isReg() || MO.isUse())
|
||||
continue;
|
||||
unsigned Reg = MO.getReg();
|
||||
@ -1589,6 +1592,11 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
|
||||
bool IsSafe = true;
|
||||
for (unsigned i = 0, e = TIB->getNumOperands(); i != e; ++i) {
|
||||
MachineOperand &MO = TIB->getOperand(i);
|
||||
// Don't attempt to hoist instructions with register masks.
|
||||
if (MO.isRegMask()) {
|
||||
IsSafe = false;
|
||||
break;
|
||||
}
|
||||
if (!MO.isReg())
|
||||
continue;
|
||||
unsigned Reg = MO.getReg();
|
||||
|
Loading…
x
Reference in New Issue
Block a user