From 21a70bf4a57568d64b535771fd20d25fc0ed9112 Mon Sep 17 00:00:00 2001 From: Cameron Zwarich Date: Fri, 20 May 2011 03:54:04 +0000 Subject: Fix PR9960 by teaching SimpleRegisterCoalescing::AdjustCopiesBackFrom() to preserve the phikill flag. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131717 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SimpleRegisterCoalescing.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/CodeGen/SimpleRegisterCoalescing.cpp') diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index 06ed66fee7..c33ce24c5e 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -252,7 +252,12 @@ bool SimpleRegisterCoalescing::AdjustCopiesBackFrom(const CoalescerPair &CP, // Okay, merge "B1" into the same value number as "B0". if (BValNo != ValLR->valno) { + // If B1 is killed by a PHI, then the merged live range must also be killed + // by the same PHI, as B0 and B1 can not overlap. + bool HasPHIKill = BValNo->hasPHIKill(); IntB.MergeValueNumberInto(BValNo, ValLR->valno); + if (HasPHIKill) + ValLR->valno->setHasPHIKill(true); } DEBUG({ dbgs() << " result = "; -- cgit v1.2.3-70-g09d2