mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228988 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
14706f93f8
commit
8b9c97493f
@ -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…
x
Reference in New Issue
Block a user