a uniform optimization technique for offset assignment problems
DESCRIPTION
A Uniform Optimization Technique for Offset Assignment Problems. Rainer Leupers, Fabian David University of Dortmund, Germany Dept. of Computer Science 12. Overview. Offset assignment problem Related work Genetic algorithm approach Exploitation of modify registers - PowerPoint PPT PresentationTRANSCRIPT
1Rainer Leupers, University of Dortmund, Computer Science Dept. ISSS ´98
A Uniform Optimization A Uniform Optimization Technique Technique
for Offset Assignment Problemsfor Offset Assignment Problems
Rainer Leupers, Fabian David
University of Dortmund, Germany
Dept. of Computer Science 12
2Rainer Leupers, University of Dortmund, Computer Science Dept. ISSS ´98
OverviewOverview
• Offset assignment problem
• Related work
• Genetic algorithm approach
• Exploitation of modify registers
• Results & conclusions
3Rainer Leupers, University of Dortmund, Computer Science Dept. ISSS ´98
Offset assignment problemOffset assignment problem
Context: Code generation for DSPsGiven: DSP address generation unit (AGU) with
# address registers (ARs): k# modify registers (MRs): mauto-increment range (AIR): r
Auto-increment capabilities:AR[i] += d, d <= rAR[i] += MR[j]
Other address computations cause extra code !
Problem: Assign program variables to memory addressesand ARs, such that the use of auto-increment address computations is maximized !
4Rainer Leupers, University of Dortmund, Computer Science Dept. ISSS ´98
Offset assignment: exampleOffset assignment: example
variables: { a, b, c, d }access sequence: (b, d, a, c, d, a, c, b, a, d, a, c, d)
AR = 1AR += 2AR -= 3AR += 2AR ++AR -= 3AR += 2AR - -AR - - AR += 3AR -= 3AR += 2AR ++
AR = 3AR - -AR - -AR - -AR += 2AR - -AR - -AR += 3AR -= 2AR ++AR - - AR - -AR += 2
c
a
d
b
0123
a
b
c
d
0123
Layout 1 Layout 2
cost: 9 cost: 5
Simple OffsetAssignment:
k = 1m = 0r = 1
5Rainer Leupers, University of Dortmund, Computer Science Dept. ISSS ´98
Related workRelated work
#ARs #MRs AIR
[Bartley92] 1 - 1
[Liao95] k - 1
[Leupers96] k m 1
[Wess97] 1 - 2
[Sudarsanam97] k - r
this work k m r
Offset assignment for different AGU models:
Further work on address optimization for fixed layout
6Rainer Leupers, University of Dortmund, Computer Science Dept. ISSS ´98
Genetic algorithm approach (1)Genetic algorithm approach (1)
Chromosomal representation: n variables, k address registers each individual is a permutation of { 1, ..., n + k - 1} example: n = 6, k = 2
2 5 3 1 7 6 4 0 1 2 3 4 5 offset mapping
switch to next AR
Fitness function:F(I) = # transitions (v,w) in access sequence, such that
v, w assigned to different ARs, or|off(v) - off(w) | <= r
AR[1] AR[2]
7Rainer Leupers, University of Dortmund, Computer Science Dept. ISSS ´98
Genetic algorithm approach (2)Genetic algorithm approach (2)
Mutation: exchange two gene values
x y y x
Crossover: standard order crossover operation
Optimization procedure: form initial population for N generations do: select parent individuals generate offspring mutate offspring emit best individual
8Rainer Leupers, University of Dortmund, Computer Science Dept. ISSS ´98
Exploitation of modify registers Exploitation of modify registers (1)(1)
[Leupers96]: Modification of Belady‘s optimal page replacement algorithm can be used for optimal exploitation of m MRs for a fixed offset assignment (only postpass optimization)
PRA(I) = # address computations that can be saved by exploiting MRs for a given offset assignment
modified fitness function: F´(I) = F(I) + PRA(I)
=> exploitation of MRs included into GA !
9Rainer Leupers, University of Dortmund, Computer Science Dept. ISSS ´98
Exploitation of modify registers Exploitation of modify registers (2)(2)
AR = 2AR - -AR += 3AR ++AR -= 2AR - -AR += 3AR -= 3AR += 2AR - -AR += 0AR += 0AR -= 2AR ++AR - -AR += 0AR += 3
AR = 2AR - -MR = 3AR += MRAR ++AR -= 2AR - - AR ++AR - - AR += MRAR -= MRMR = 2AR += MRAR - -AR += 0AR += 0AR -= MRAR ++AR - -AR ++AR += 0AR += 3
AR = 4AR ++MR = 2AR -= MRAR -= MRAR ++AR += MRAR -= MRAR += MRMR = 3AR -= MRAR += MRAR - - AR - - AR += 0AR += 0AR += MRAR - -AR ++AR - -AR += 0AR -= MR
v4
v0
v2
v1
v3
v4
v0
v2
v1
v3
v3
v2
v1
v0
v4
0
1
2
3
4
0
1
2
3
4
0
1
2
3
4
heuristic OA heuristic OA+ PRA
geneticalgorithm
10Rainer Leupers, University of Dortmund, Computer Science Dept. ISSS ´98
Results & conclusionsResults & conclusions
Statistical evaluation: 32 % improvement over OA heuristic with postpass MR optimization 32 % improvement over Wess‘ simulated annealing technique Runtime: typically 10 CPU seconds (Pentium II)
Main contributions: First uniform offset assignment technique, arbitrary k, m, r values Significant improvements in code quality over previous techniques, largely due to better exploitation of MRs