1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

Fix LSR compile time hang.

Summary:
Limit number of reassociations in GenerateReassociationsImpl.

Reviewers: qcolombet, mkazantsev

Differential Revision: https://reviews.llvm.org/D46039

From: Evgeny Stupachenko <evstupac@gmail.com>
                         <evgeny.v.stupachenko@intel.com>
llvm-svn: 332426
This commit is contained in:
Evgeny Stupachenko 2018-05-16 02:48:50 +00:00
parent e0665809b0
commit 1fcb36773e
2 changed files with 1342 additions and 1 deletions

View File

@ -3598,7 +3598,12 @@ void LSRInstance::GenerateReassociationsImpl(LSRUse &LU, unsigned LUIdx,
if (InsertFormula(LU, LUIdx, F))
// If that formula hadn't been seen before, recurse to find more like
// it.
GenerateReassociations(LU, LUIdx, LU.Formulae.back(), Depth + 1);
// Add check on Log16(AddOps.size()) - same as Log2_32(AddOps.size()) >> 2)
// Because just Depth is not enough to bound compile time.
// This means that every time AddOps.size() is greater 16^x we will add
// x to Depth.
GenerateReassociations(LU, LUIdx, LU.Formulae.back(),
Depth + 1 + (Log2_32(AddOps.size()) >> 2));
}
}

File diff suppressed because it is too large Load Diff