Fix PR8815 by checking for an explicit clobber def tied to a use operand in
authorCameron Zwarich <zwarich@apple.com>
Sun, 19 Dec 2010 22:12:45 +0000 (22:12 +0000)
committerCameron Zwarich <zwarich@apple.com>
Sun, 19 Dec 2010 22:12:45 +0000 (22:12 +0000)
ConnectedVNInfoEqClasses::Classify().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122202 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveInterval.cpp

index 3c18017f3fc3c442c50f86ba5844dcff94780952..16551ab5d080969bf6b50625f3fb4afc80c37dfc 100644 (file)
@@ -769,6 +769,14 @@ unsigned ConnectedVNInfoEqClasses::Classify(const LiveInterval *LI) {
       // operand constraint?
       if (const VNInfo *UVNI = LI->getVNInfoAt(VNI->def.getUseIndex()))
         Connect(VNI->id, UVNI->id);
+
+      // Check for a tied operand constraint involving an early clobber def,
+      // where one VN ends right before the use index and the next VN is defined
+      // at the same use index.
+      if (VNI->def.isUse()) {
+        if (const VNInfo *PVNI = LI->getVNInfoAt(VNI->def.getLoadIndex()))
+          Connect(PVNI->id, VNI->id);
+      }
     }
   }