forked from OSchip/llvm-project
Fix LSR best register search algorithm.
Summary: Fix a case when first register in a search has maximum RegUses.getUsedByIndices(Reg).count() Reviewers: qcolombet Differential Revision: http://reviews.llvm.org/D26877 From: Evgeny Stupachenko <evstupac@gmail.com> llvm-svn: 288278
This commit is contained in:
parent
c52fe2961c
commit
0c4300fac7
|
@ -4178,9 +4178,10 @@ void LSRInstance::NarrowSearchSpaceByPickingWinnerRegs() {
|
|||
for (const SCEV *Reg : RegUses) {
|
||||
if (Taken.count(Reg))
|
||||
continue;
|
||||
if (!Best)
|
||||
if (!Best) {
|
||||
Best = Reg;
|
||||
else {
|
||||
BestNum = RegUses.getUsedByIndices(Reg).count();
|
||||
} else {
|
||||
unsigned Count = RegUses.getUsedByIndices(Reg).count();
|
||||
if (Count > BestNum) {
|
||||
Best = Reg;
|
||||
|
|
Loading…
Reference in New Issue