[llvm-commits] [llvm] r129882 - /llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Apr 20 15:14:17 PDT 2011


Author: stoklund
Date: Wed Apr 20 17:14:17 2011
New Revision: 129882

URL: http://llvm.org/viewvc/llvm-project?rev=129882&view=rev
Log:
Permit remat when a virtual register has multiple defs.

TII::isTriviallyReMaterializable() shouldn't depend on any properties of the
register being defined by the instruction. Rematerialization is going to create
a new virtual register anyway.

Modified:
    llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp

Modified: llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp?rev=129882&r1=129881&r2=129882&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp (original)
+++ llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp Wed Apr 20 17:14:17 2011
@@ -388,11 +388,6 @@
     if (MO.isDef() != (i == 0))
       return false;
 
-    // For the def, it should be the only def of that register.
-    if (MO.isDef() && (llvm::next(MRI.def_begin(Reg)) != MRI.def_end() ||
-                       MRI.isLiveIn(Reg)))
-      return false;
-
     // Don't allow any virtual-register uses. Rematting an instruction with
     // virtual register uses would length the live ranges of the uses, which
     // is not necessarily a good idea, certainly not "trivial".





More information about the llvm-commits mailing list