当前位置:网站首页>DCC888 :Register Allocation
DCC888 :Register Allocation
2022-06-27 22:32:00 【Spring river flower moon night morning】
Register Allocation
Register Allocation
(0)These values might be stored either in registers, or in memory.
(1)Registers are fast, but they come in small quantity.
(2)Memory is plenty, but it has slower access time.
(3) A good register allocator should strive to keep in registers the variables used more often.

the three aspects of register allocation
register assignment
The task of determining in which register each variable will be kept
spill
If a variable must be mapped into memory, we call it a spill.
Spilling is the task of determining which variables must be mapped to memory.
coalescing
If we can assign the same register to two variables related by a move instruction, then we can eliminate this move. This optimization is called coalescing.

register constraints


maxLive :MaxLive is the maximum number of registers that are simultaneously alive at any program point of the program’s control flow graph.
MinReg :The minimum number of registers that a program needs,
MinReg > MaxLive

@ = e, c Of this node input yes c -> r1,e-> r2;
c = d, Of this node input yes d->r1, e->r2;
e = a, Of this node input yes d->r1, a->r2; At this point, the discovery and the initial assumption a->r1 Conflict .
Register Assignment is NP-Complete

Chaitin’s proof

the interference graph



Linear Scan
It is based on the greedy coloring of interval graphs:
– Given a sequence of intervals, we want to find the minimum number of colors necessary to paint them, so that overlapping intervals are given different colors.

Linearization of Basic Blocks
reverse post-order





first :r3 ->c
second: r1->a

intervals once spill
spill To memory, Will interrupt variable Life cycle 

spill :need store/load placemeng


coalescing



live ranges with holes



graph coloring register allocation
the interference graph




simplification When , take node Put it on the stack at one time .
r3 - r1 - r2 - e - c - b - a - d
reverse order : d - a - b - c - e - r2 - r1 - r3
greedy coloring



iterated register coalescing








spilling heuristics


spilling



Among them d For example :2 yes d stay loop In addition to the def and use,10 To the power of d Of loop nesting factor yes 1, multiply 2 Because loop Within def and use two ,d Of degree by 4.













边栏推荐
- Record a list object traversal and determine the size of the float type
- 如何做好功能测试?你确定不想知道吗?
- Structured machine learning project (I) - machine learning strategy
- mysql 大于 小于 等于符号的表示方法
- Codeforces Round #723 (Div. 2)
- The "business and Application Security Development Forum" held by the ICT Institute was re recognized for the security capability of Tianyi cloud
- The karsonzhang/fastadmin addons provided by the system reports an error
- 百万年薪独家专访,开发人员不修复bug怎么办?
- Flask application case
- Open source technology exchange - Introduction to Chengying, a one-stop fully automated operation and maintenance manager
猜你喜欢

7 jours d'apprentissage de la programmation simultanée go 7 jours de programmation simultanée go Language Atomic Atomic Atomic actual Operation contains ABA Problems

Common problems encountered by burp Suite

Professor of Tsinghua University: software testing has gone into a misunderstanding - "code is necessary"

The create database of gbase 8A takes a long time to query and is suspected to be stuck

Luogu p5706 redistributing fertilizer and house water

《7天学会Go并发编程》第7天 go语言并发编程Atomic原子实战操作含ABA问题

Exclusive interview with millions of annual salary. What should developers do if they don't fix bugs?

真香,自从用了Charles,Fiddler已经被我彻底卸载了

结构化机器学习项目(一)- 机器学习策略

Structured machine learning project (I) - machine learning strategy
随机推荐
Gbase 8A method for reducing the impact on the system by controlling resource usage through concurrency during node replacement of V8 version
Go from introduction to actual combat - task cancellation (note)
从学生到工程师的蜕变之路
Management system itclub (Part 2)
Learn to go concurrent programming in 7 days go language sync Application and implementation of cond
Dialogue with Qiao Xinyu: the user is the product manager of Wei brand, and zero anxiety defines luxury
Software defect management - a must for testers
记一次List对象遍历及float类型判断大小
[MySQL practice] query statement demonstration
Stm32cubeide1.9.0\stm32cubemx 6.5 f429igt6 plus lan8720a, configure eth+lwip
使用sqlite3语句后出现省略号 ... 的解决方法
How to prioritize the contents in the queue every second
Matlab finds the position of a row or column in the matrix
Gao fushuai in the unit testing industry, pytest framework, hands-on teaching, will do this in the future test reports~
C # QR code generation and recognition, removing white edges and any color
Transformation from student to engineer
Ellipsis after SQLite3 statement Solutions for
Example of using gbase 8A OLAP function group by grouping sets
Structured machine learning project (II) - machine learning strategy (2)
OpenSSL programming I: basic concepts