diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-05-25 16:39:47 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-05-25 16:39:47 +0000 |
commit | 3955360b24c7c70f2dcf301a3f59a2fc89e50238 (patch) | |
tree | de0b019653f97f893d8ef75ae7a2aa186c8a0ed6 /llvm/lib | |
parent | d884927463d772adbbbf1073b2a3187c2a82d5b0 (diff) | |
download | bcm5719-llvm-3955360b24c7c70f2dcf301a3f59a2fc89e50238.tar.gz bcm5719-llvm-3955360b24c7c70f2dcf301a3f59a2fc89e50238.zip |
[x86, AVX] allow explicit calls to VZERO* to modify state in VZeroUpperInserter pass (PR27823)
As noted in the review, there are still problems, so this doesn't the bug completely.
Differential Revision: http://reviews.llvm.org/D20529
llvm-svn: 270718
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/X86/X86VZeroUpper.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/X86VZeroUpper.cpp b/llvm/lib/Target/X86/X86VZeroUpper.cpp index 4465c0f988d..944c76ae68a 100644 --- a/llvm/lib/Target/X86/X86VZeroUpper.cpp +++ b/llvm/lib/Target/X86/X86VZeroUpper.cpp @@ -188,14 +188,15 @@ void VZeroUpperInserter::processBasicBlock(MachineBasicBlock &MBB) { bool IsReturnFromX86INTR = IsX86INTR && MI->isReturn(); bool IsControlFlow = MI->isCall() || MI->isReturn(); - // Shortcut: don't need to check regular instructions in dirty state. - if ((!IsControlFlow || IsReturnFromX86INTR) && CurState == EXITS_DIRTY) + // An existing VZERO* instruction resets the state. + if (MI->getOpcode() == X86::VZEROALL || + MI->getOpcode() == X86::VZEROUPPER) { + CurState = EXITS_CLEAN; continue; + } - // Ignore existing VZERO* instructions. - // FIXME: The existence of these instructions should be used to modify the - // current state and/or used when deciding whether we need to create a VZU. - if (MI->getOpcode() == X86::VZEROALL || MI->getOpcode() == X86::VZEROUPPER) + // Shortcut: don't need to check regular instructions in dirty state. + if ((!IsControlFlow || IsReturnFromX86INTR) && CurState == EXITS_DIRTY) continue; if (hasYmmReg(MI)) { |