Numerous bug fixes:
-- correct sign extensions for integer casts and for shift-by-constant
instructions generated for integer multiply
-- passing FP arguments to functions with more than 6 arguments
-- passing FP arguments to varargs functions
-- passing FP arguments to functions with no prototypes
-- incorrect stack frame size when padding a section
-- folding getelementptr operations with mixed array and struct indexes
-- use uint64_t instead of uint for constant offsets in mem operands
-- incorrect coloring for CC registers (both int and FP): interferences
were being completely ignored for int CC and were considered but no
spills were marked for fp CC!
Also some code improvements:
-- better interface to generating machine instr for common cases
(many places still need to be updated to use this interface)
-- annotations on MachineInstr to communicate information from
one codegen phase to another (now used to pass information about
CALL/JMPLCALL operands from selection to register allocation)
-- all sizes and offests in class TargetData are uint64_t instead of uint
llvm-svn: 2640
diff --git a/llvm/lib/Target/Sparc/SparcRegClassInfo.h b/llvm/lib/Target/Sparc/SparcRegClassInfo.h
index 67d3f33..ab5b35c 100644
--- a/llvm/lib/Target/Sparc/SparcRegClassInfo.h
+++ b/llvm/lib/Target/Sparc/SparcRegClassInfo.h
@@ -191,15 +191,17 @@
struct SparcIntCCRegClass : public MachineRegClassInfo {
SparcIntCCRegClass(unsigned ID)
: MachineRegClassInfo(ID, 1, 2) { }
-
+
inline void colorIGNode(IGNode *Node, bool IsColorUsedArr[]) const {
- Node->setColor(0); // only one int cc reg is available
+ if (IsColorUsedArr[0])
+ Node->getParentLR()->markForSpill();
+ else
+ Node->setColor(0); // only one int cc reg is available
}
-
+
// according to Sparc 64 ABI, %ccr is volatile
//
inline bool isRegVolatile(int Reg) const { return true; }
-
};
@@ -231,11 +233,13 @@
void colorIGNode(IGNode *Node, bool IsColorUsedArr[]) const {
int c;
- for(c=0; c < 4 && IsColorUsedArr[c] ; ++c) ; // find color
- assert ((c < 4) && "Can allocate only 4 float cc registers");
- Node->setColor(c);
+ for(c=0; c < 4 && IsColorUsedArr[c] ; ++c) ; // find unused color
+ if (c < 4)
+ Node->setColor(c);
+ else
+ Node->getParentLR()->markForSpill();
}
-
+
// according to Sparc 64 ABI, all %fp CC regs are volatile
//
inline bool isRegVolatile(int Reg) const { return true; }