Work around code generation bug in Visual Studio 2010.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 24 May 2011 03:20:56 +0000 (03:20 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 24 May 2011 03:20:56 +0000 (03:20 +0000)
See http://llvm.org/pr9976 for details.

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

include/llvm/Target/TargetRegisterInfo.h

index 205e76f9c6fcad4ddd0e5532e1e7261ca47a1105..afa395f3d7332bf7ce63c29c8ecc7848e2d8edc1 100644 (file)
@@ -351,13 +351,13 @@ public:
   /// 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