mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
X86: VZeroUpperInserter: shortcut should not trigger if we have any function live-ins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225419 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -254,16 +254,20 @@ bool VZeroUpperInserter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
MachineRegisterInfo &MRI = MF.getRegInfo();
|
MachineRegisterInfo &MRI = MF.getRegInfo();
|
||||||
EverMadeChange = false;
|
EverMadeChange = false;
|
||||||
|
|
||||||
|
bool FnHasLiveInYmm = checkFnHasLiveInYmm(MRI);
|
||||||
|
|
||||||
// Fast check: if the function doesn't use any ymm registers, we don't need
|
// Fast check: if the function doesn't use any ymm registers, we don't need
|
||||||
// to insert any VZEROUPPER instructions. This is constant-time, so it is
|
// to insert any VZEROUPPER instructions. This is constant-time, so it is
|
||||||
// cheap in the common case of no ymm use.
|
// cheap in the common case of no ymm use.
|
||||||
bool YMMUsed = false;
|
bool YMMUsed = FnHasLiveInYmm;
|
||||||
const TargetRegisterClass *RC = &X86::VR256RegClass;
|
if (!YMMUsed) {
|
||||||
for (TargetRegisterClass::iterator i = RC->begin(), e = RC->end();
|
const TargetRegisterClass *RC = &X86::VR256RegClass;
|
||||||
i != e; i++) {
|
for (TargetRegisterClass::iterator i = RC->begin(), e = RC->end(); i != e;
|
||||||
if (!MRI.reg_nodbg_empty(*i)) {
|
i++) {
|
||||||
YMMUsed = true;
|
if (!MRI.reg_nodbg_empty(*i)) {
|
||||||
break;
|
YMMUsed = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!YMMUsed) {
|
if (!YMMUsed) {
|
||||||
@@ -282,7 +286,7 @@ bool VZeroUpperInserter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
|
|
||||||
// If any YMM regs are live in to this function, add the entry block to the
|
// If any YMM regs are live in to this function, add the entry block to the
|
||||||
// DirtySuccessors list
|
// DirtySuccessors list
|
||||||
if (checkFnHasLiveInYmm(MRI))
|
if (FnHasLiveInYmm)
|
||||||
addDirtySuccessor(MF.front());
|
addDirtySuccessor(MF.front());
|
||||||
|
|
||||||
// Re-visit all blocks that are successors of EXITS_DIRTY bsocks. Add
|
// Re-visit all blocks that are successors of EXITS_DIRTY bsocks. Add
|
||||||
|
Reference in New Issue
Block a user