[llvm-commits] [llvm] r131954 - /llvm/trunk/include/llvm/Target/TargetRegisterInfo.h

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon May 23 20:20:56 PDT 2011


Author: stoklund
Date: Mon May 23 22:20:56 2011
New Revision: 131954

URL: http://llvm.org/viewvc/llvm-project?rev=131954&view=rev
Log:
Work around code generation bug in Visual Studio 2010.

See http://llvm.org/pr9976 for details.

Modified:
    llvm/trunk/include/llvm/Target/TargetRegisterInfo.h

Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=131954&r1=131953&r2=131954&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetRegisterInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Mon May 23 22:20:56 2011
@@ -351,13 +351,13 @@
   /// The first virtual register in a function will get the index 0.
   static unsigned virtReg2Index(unsigned Reg) {
     assert(isVirtualRegister(Reg) && "Not a virtual register");
-    return Reg - (1u << 31);
+    return Reg & ~(1u << 31);
   }
 
   /// index2VirtReg - Convert a 0-based index to a virtual register number.
   /// This is the inverse operation of VirtReg2IndexFunctor below.
   static unsigned index2VirtReg(unsigned Index) {
-    return Index + (1u << 31);
+    return Index | (1u << 31);
   }
 
   /// getMinimalPhysRegClass - Returns the Register Class of a physical





More information about the llvm-commits mailing list