llvm.org GIT mirror llvm / 9a6615d
Merging r231658: ------------------------------------------------------------------------ r231658 | marek.olsak | 2015-03-09 11:48:00 -0400 (Mon, 09 Mar 2015) | 2 lines R600/SI: Fix getNumSGPRsAllowed for VI ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_36@236037 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 5 years ago
2 changed file(s) with 26 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
1313
1414
1515 #include "SIRegisterInfo.h"
16 #include "AMDGPUSubtarget.h"
1716 #include "SIInstrInfo.h"
1817 #include "SIMachineFunctionInfo.h"
1918 #include "llvm/CodeGen/MachineFrameInfo.h"
5251 unsigned SIRegisterInfo::getRegPressureSetLimit(unsigned Idx) const {
5352
5453 // FIXME: We should adjust the max number of waves based on LDS size.
55 unsigned SGPRLimit = getNumSGPRsAllowed(ST.getMaxWavesPerCU());
54 unsigned SGPRLimit = getNumSGPRsAllowed(ST.getGeneration(),
55 ST.getMaxWavesPerCU());
5656 unsigned VGPRLimit = getNumVGPRsAllowed(ST.getMaxWavesPerCU());
5757
5858 for (regclass_iterator I = regclass_begin(), E = regclass_end();
493493 }
494494 }
495495
496 unsigned SIRegisterInfo::getNumSGPRsAllowed(unsigned WaveCount) const {
497 switch(WaveCount) {
498 case 10: return 48;
499 case 9: return 56;
500 case 8: return 64;
501 case 7: return 72;
502 case 6: return 80;
503 case 5: return 96;
504 default: return 103;
505 }
506 }
496 unsigned SIRegisterInfo::getNumSGPRsAllowed(AMDGPUSubtarget::Generation gen,
497 unsigned WaveCount) const {
498 if (gen >= AMDGPUSubtarget::VOLCANIC_ISLANDS) {
499 switch (WaveCount) {
500 case 10: return 80;
501 case 9: return 80;
502 case 8: return 96;
503 default: return 102;
504 }
505 } else {
506 switch(WaveCount) {
507 case 10: return 48;
508 case 9: return 56;
509 case 8: return 64;
510 case 7: return 72;
511 case 6: return 80;
512 case 5: return 96;
513 default: return 103;
514 }
515 }
516 }
1616 #define LLVM_LIB_TARGET_R600_SIREGISTERINFO_H
1717
1818 #include "AMDGPURegisterInfo.h"
19 #include "AMDGPUSubtarget.h"
1920 #include "llvm/Support/Debug.h"
2021
2122 namespace llvm {
110111
111112 /// \brief Give the maximum number of SGPRs that can be used by \p WaveCount
112113 /// concurrent waves.
113 unsigned getNumSGPRsAllowed(unsigned WaveCount) const;
114 unsigned getNumSGPRsAllowed(AMDGPUSubtarget::Generation gen,
115 unsigned WaveCount) const;
114116
115117 unsigned findUnusedRegister(const MachineRegisterInfo &MRI,
116118 const TargetRegisterClass *RC) const;