Make %EFLAGS unallocatable.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 31 Aug 2010 21:51:07 +0000 (21:51 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 31 Aug 2010 21:51:07 +0000 (21:51 +0000)
No CCR virtual registers should exist, and %EFLAGS is used in ways that can
surprise RegAllocFast.

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

lib/Target/X86/X86RegisterInfo.td

index 176e87812d21706d9c76a58c8e60af4ab0c72646..95269b15760e0f956f5d610bdf90ea808b200b59 100644 (file)
@@ -833,4 +833,15 @@ def VR256 : RegisterClass<"X86", [v32i8, v8i32, v4i64, v8f32, v4f64], 256,
 // Status flags registers.
 def CCR : RegisterClass<"X86", [i32], 32, [EFLAGS]> {
   let CopyCost = -1;  // Don't allow copying of status registers.
+
+  // EFLAGS is not allocatable.
+  let MethodProtos = [{
+    iterator allocation_order_end(const MachineFunction &MF) const;
+  }];
+  let MethodBodies = [{
+    CCRClass::iterator
+    CCRClass::allocation_order_end(const MachineFunction &MF) const {
+      return allocation_order_begin(MF);
+    }
+  }];
 }