forked from OSchip/llvm-project
Prevent division by 0.
When we try to estimate number of potentially removed instructions in loop unroller, we analyze first N iterations and then scale the computed number by TripCount/N. We should bail out early if N is 0. llvm-svn: 228988
This commit is contained in:
parent
186ad60815
commit
1b48019751
|
@ -548,7 +548,7 @@ static unsigned
|
|||
approximateNumberOfOptimizedInstructions(const Loop *L, ScalarEvolution &SE,
|
||||
unsigned TripCount,
|
||||
const TargetTransformInfo &TTI) {
|
||||
if (!TripCount)
|
||||
if (!TripCount || !UnrollMaxIterationsCountToAnalyze)
|
||||
return 0;
|
||||
|
||||
UnrollAnalyzer UA(L, TripCount, SE, TTI);
|
||||
|
|
Loading…
Reference in New Issue