mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-15 14:28:25 +00:00
Handle register masks when searching for EFLAGS clobbers.
Calls clobber the flags, but when using register masks there is no EFLAGS<imp-def> operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150117 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
39284d191a
commit
450b3850ce
@ -1419,6 +1419,8 @@ static bool isSafeToClobberEFLAGS(MachineBasicBlock &MBB,
|
|||||||
bool SeenDef = false;
|
bool SeenDef = false;
|
||||||
for (unsigned j = 0, e = Iter->getNumOperands(); j != e; ++j) {
|
for (unsigned j = 0, e = Iter->getNumOperands(); j != e; ++j) {
|
||||||
MachineOperand &MO = Iter->getOperand(j);
|
MachineOperand &MO = Iter->getOperand(j);
|
||||||
|
if (MO.isRegMask() && MO.clobbersPhysReg(X86::EFLAGS))
|
||||||
|
SeenDef = true;
|
||||||
if (!MO.isReg())
|
if (!MO.isReg())
|
||||||
continue;
|
continue;
|
||||||
if (MO.getReg() == X86::EFLAGS) {
|
if (MO.getReg() == X86::EFLAGS) {
|
||||||
@ -1463,6 +1465,10 @@ static bool isSafeToClobberEFLAGS(MachineBasicBlock &MBB,
|
|||||||
bool SawKill = false;
|
bool SawKill = false;
|
||||||
for (unsigned j = 0, e = Iter->getNumOperands(); j != e; ++j) {
|
for (unsigned j = 0, e = Iter->getNumOperands(); j != e; ++j) {
|
||||||
MachineOperand &MO = Iter->getOperand(j);
|
MachineOperand &MO = Iter->getOperand(j);
|
||||||
|
// A register mask may clobber EFLAGS, but we should still look for a
|
||||||
|
// live EFLAGS def.
|
||||||
|
if (MO.isRegMask() && MO.clobbersPhysReg(X86::EFLAGS))
|
||||||
|
SawKill = true;
|
||||||
if (MO.isReg() && MO.getReg() == X86::EFLAGS) {
|
if (MO.isReg() && MO.getReg() == X86::EFLAGS) {
|
||||||
if (MO.isDef()) return MO.isDead();
|
if (MO.isDef()) return MO.isDead();
|
||||||
if (MO.isKill()) SawKill = true;
|
if (MO.isKill()) SawKill = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user