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:
parent
e0665809b0
commit
1fcb36773e
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
1336
test/Transforms/LoopStrengthReduce/lsr-comp-time.ll
Normal file
1336
test/Transforms/LoopStrengthReduce/lsr-comp-time.ll
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user