diff options
author | Elena Demikhovsky <elena.demikhovsky@intel.com> | 2013-02-13 08:02:04 +0000 |
---|---|---|
committer | Elena Demikhovsky <elena.demikhovsky@intel.com> | 2013-02-13 08:02:04 +0000 |
commit | d29804f80d1cc26ea552b58693ce883f5b13de7a (patch) | |
tree | aeb300a914122fd17fdf0a6d4f6184bf650ba49f /lib/Target/X86 | |
parent | cef6cfe4a67af030754b4151cd63076c4aab7467 (diff) | |
download | external_llvm-d29804f80d1cc26ea552b58693ce883f5b13de7a.zip external_llvm-d29804f80d1cc26ea552b58693ce883f5b13de7a.tar.gz external_llvm-d29804f80d1cc26ea552b58693ce883f5b13de7a.tar.bz2 |
Prevent insertion of "vzeroupper" before call that preserves YMM registers, since a caller uses preserved registers across the call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175043 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86')
-rw-r--r-- | lib/Target/X86/X86VZeroUpper.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Target/X86/X86VZeroUpper.cpp b/lib/Target/X86/X86VZeroUpper.cpp index c4a5887..0f77948 100644 --- a/lib/Target/X86/X86VZeroUpper.cpp +++ b/lib/Target/X86/X86VZeroUpper.cpp @@ -120,9 +120,19 @@ static bool checkFnHasLiveInYmm(MachineRegisterInfo &MRI) { return false; } +static bool clobbersAllYmmRegs(const MachineOperand &MO) { + for (unsigned reg = X86::YMM0; reg < X86::YMM15; ++reg) { + if (!MO.clobbersPhysReg(reg)) + return false; + } + return true; +} + static bool hasYmmReg(MachineInstr *MI) { for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { const MachineOperand &MO = MI->getOperand(i); + if (MI->isCall() && MO.isRegMask() && !clobbersAllYmmRegs(MO)) + return true; if (!MO.isReg()) continue; if (MO.isDebug()) |