forked from OSchip/llvm-project
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:
parent
5412b21d24
commit
bff9302c3d
|
@ -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
Loading…
Reference in New Issue