当前位置:网站首页>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.













边栏推荐
- Day8 - cloud information project introduction and creation
- 【Redis】零基础十分钟学会Redis
- Yolov6: the fast and accurate target detection framework is open source
- Login credentials (cookie+session and token token)
- Start the start php
- Read write separation master-slave replication of MySQL
- Go language slice vs array panic: runtime error: index out of range problem solving
- 管理系統-ITclub(下)
- Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing
- 6G显卡显存不足出现CUDA Error:out of memory解决办法
猜你喜欢

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

Structured machine learning project (II) - machine learning strategy (2)

从学生到工程师的蜕变之路

Test birds with an annual salary of 50w+ are using this: JMeter script development -- extension function

Management system itclub (Part 1)

Read write separation master-slave replication of MySQL

Go from introduction to practice -- shared memory concurrency mechanism (notes)

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

Stm32cubeide1.9.0\stm32cubemx 6.5 f429igt6 plus lan8720a, configure eth+lwip

Crawler notes (1) - urllib
随机推荐
Bean paste green protects your eyes
管理系統-ITclub(下)
Crontab scheduled task common commands
Summary of gbase 8A database user password security related parameters
Crawler notes (2) - parse
北京邮电大学|用于成本和延迟敏感的虚拟网络功能放置和路由的多智能体深度强化学习
gomock mockgen : unknown embedded interface
Gbase 8A OLAP analysis function cume_ Example of dist
Dynamic refresh mapper
结构化机器学习项目(一)- 机器学习策略
【Redis】零基础十分钟学会Redis
Conversion between flat array and JSON tree
Infiltration learning - problems encountered during SQL injection - explanation of sort=left (version(), 1) - understanding of order by followed by string
《7天学会Go并发编程》第7天 go语言并发编程Atomic原子实战操作含ABA问题
Codeforces Round #721 (Div. 2)
Selenium上传文件有多少种方式?不信你有我全!
中金证券经理给的开户链接办理股票开户安全吗?我想开个户
Structured machine learning project (I) - machine learning strategy
美团20k软件测试工程师的经验分享
Experience sharing of meituan 20K Software Test Engineers