[llvm-commits] [llvm] r166110 - /llvm/trunk/lib/Target/X86/X86VZeroUpper.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Oct 17 10:52:35 PDT 2012


Author: stoklund
Date: Wed Oct 17 12:52:35 2012
New Revision: 166110

URL: http://llvm.org/viewvc/llvm-project?rev=166110&view=rev
Log:
Check for empty YMM use-def lists in X86VZeroUpper.

The previous MRI.isPhysRegUsed(YMM0) would also return true when the
function contains a call to a function that may clobber YMM0. That's
most of them.

Checking the use-def chains allows us to skip functions that don't
explicitly mention YMM registers.

Modified:
    llvm/trunk/lib/Target/X86/X86VZeroUpper.cpp

Modified: llvm/trunk/lib/Target/X86/X86VZeroUpper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86VZeroUpper.cpp?rev=166110&r1=166109&r2=166110&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86VZeroUpper.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86VZeroUpper.cpp Wed Oct 17 12:52:35 2012
@@ -147,7 +147,7 @@
   const TargetRegisterClass *RC = &X86::VR256RegClass;
   for (TargetRegisterClass::iterator i = RC->begin(), e = RC->end();
        i != e; i++) {
-    if (MRI.isPhysRegUsed(*i)) {
+    if (!MRI.reg_nodbg_empty(*i)) {
       YMMUsed = true;
       break;
     }





More information about the llvm-commits mailing list