mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-30 16:17:05 +00:00 
			
		
		
		
	Add a MinNumRegs argument to MRI::constrainRegClass().
The function will refuse to use a register class with fewer registers than MinNumRegs. This can be used by clients to avoid accidentally increase register pressure too much. The default value of MinNumRegs=0 doesn't affect how constrainRegClass() works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140339 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -49,15 +49,17 @@ MachineRegisterInfo::setRegClass(unsigned Reg, const TargetRegisterClass *RC) { | ||||
|  | ||||
| const TargetRegisterClass * | ||||
| MachineRegisterInfo::constrainRegClass(unsigned Reg, | ||||
|                                        const TargetRegisterClass *RC) { | ||||
|                                        const TargetRegisterClass *RC, | ||||
|                                        unsigned MinNumRegs) { | ||||
|   const TargetRegisterClass *OldRC = getRegClass(Reg); | ||||
|   if (OldRC == RC) | ||||
|     return RC; | ||||
|   const TargetRegisterClass *NewRC = getCommonSubClass(OldRC, RC); | ||||
|   if (!NewRC) | ||||
|   if (!NewRC || NewRC == OldRC) | ||||
|     return NewRC; | ||||
|   if (NewRC->getNumRegs() < MinNumRegs) | ||||
|     return 0; | ||||
|   if (NewRC != OldRC) | ||||
|     setRegClass(Reg, NewRC); | ||||
|   setRegClass(Reg, NewRC); | ||||
|   return NewRC; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user