[llvm-commits] [llvm] r102027 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp test/CodeGen/X86/2010-04-21-CoalescerBug.ll

Evan Cheng evan.cheng at apple.com
Wed Apr 21 13:57:54 PDT 2010


Author: evancheng
Date: Wed Apr 21 15:57:54 2010
New Revision: 102027

URL: http://llvm.org/viewvc/llvm-project?rev=102027&view=rev
Log:
Do not try to optimize a copy that has already been marked for deletion.

Added:
    llvm/trunk/test/CodeGen/X86/2010-04-21-CoalescerBug.ll
Modified:
    llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp

Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=102027&r1=102026&r2=102027&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Wed Apr 21 15:57:54 2010
@@ -804,7 +804,8 @@
           CopySrcReg == SrcReg && CopyDstReg != UseDstReg) {
         // If the use is a copy and it won't be coalesced away, and its source
         // is defined by a trivial computation, try to rematerialize it instead.
-        if (ReMaterializeTrivialDef(li_->getInterval(SrcReg), CopyDstReg,
+        if (!JoinedCopies.count(UseMI) &&
+            ReMaterializeTrivialDef(li_->getInterval(SrcReg), CopyDstReg,
                                     CopyDstSubIdx, UseMI))
           continue;
       }

Added: llvm/trunk/test/CodeGen/X86/2010-04-21-CoalescerBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-04-21-CoalescerBug.ll?rev=102027&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2010-04-21-CoalescerBug.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2010-04-21-CoalescerBug.ll Wed Apr 21 15:57:54 2010
@@ -0,0 +1,15 @@
+; RUN: llc < %s -mtriple=x86_64-apple-darwin
+; rdar://7886733
+
+%struct.CMTime = type <{ i64, i32, i32, i64 }>
+%struct.CMTimeMapping = type { %struct.CMTimeRange, %struct.CMTimeRange }
+%struct.CMTimeRange = type { %struct.CMTime, %struct.CMTime }
+
+define void @t(%struct.CMTimeMapping* noalias nocapture sret %agg.result) nounwind optsize ssp {
+entry:
+  %agg.result1 = bitcast %struct.CMTimeMapping* %agg.result to i8* ; <i8*> [#uses=1]
+  tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %agg.result1, i8* null, i64 96, i32 4, i1 false)
+  ret void
+}
+
+declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind





More information about the llvm-commits mailing list