Work around code generation bug in Visual Studio 2010.

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

llvm-svn: 131954
This commit is contained in:
Jakob Stoklund Olesen 2011-05-24 03:20:56 +00:00
parent 843bc7d673
commit 0130027dec
1 changed files with 2 additions and 2 deletions

View 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