@article{oai:ipsj.ixsq.nii.ac.jp:00016898, author = {稲垣, 達氏 and 古関, 聰 and 小松, 秀昭 and Tatsushi, Inagaki and Akira, Koseki and Hideaki, Komatsu}, issue = {SIG02(PRO9)}, journal = {情報処理学会論文誌プログラミング(PRO)}, month = {Feb}, note = {コンパイラにおける共通部分式削除やコピー伝搬などのアーキテクチャ独立な最適化と,レジスタ割付やコードスケジューリングなどのアーキテクチャ依存の最適化は,それぞれ独立したヒューリスティクスに基づいた,異なるパスとして実現されている.実際には共通部分式削除やコピー伝搬も,対象アーキテクチャの物理レジスタ数制約に対してトレードオフを持っている.しかし,これらの問題を完全に協調的に解くことは非常に計算コストが高く,現実的ではない.本研究では,アーキテクチャ独立な最適化とアーキテクチャ依存最適化の間に,物理レジスタ数の制約によるトレードオフを緩和するパスを設けることで,アーキテクチャ独立な最適化およびアーキテクチャ依存な最適化の効果を上げる手法を示す.本方式は,基本ブロック内の中間コードを演算子の依存グラフで表現し,使用レジスタ数を見積もりながら1パスの4つ組生成を行う.使用レジスタ数が少ない部分では,コードスケジューリングに対して不必要な制約を導入しないように,クリティカルパス上の演算子が連続するような4つ組生成を行う.使用レジスタ数が多い部分では,レジスタ割付時に余分なスピルコードを発生させないように,一時変数を減らすような順番で4つ組を生成する., In current compilers, architecture independent code optimizations, such as common subexpression elimination and copy propagation, and architecture dependent optimizations, such as register allocation and code scheduling, are implemented as separate passes that have mutually independent heuristics. Actually, common subexpression and copy propagation also have some tradeoff against the number of physical registers of the target architecture. However, cooperative solution of these problems requires high computation cost. In this paper, we solve this problem by inserting an additional pass between architecture independent code optimizations and architecture dependent optimizations to alleviate the constraint of the number of physical registers and improve results of both optimizations. Operations in a basic block are represented by DAG (directed acyclic graph). We apply one-pass quadruple generation algorithm that considers the number of currently used registers. When register pressure is low, operations on the critical path are continuously generated not to introduce unnecessary constraint for code scheduler. When register pressure is high, we prioritize operations that reduce the number of temporary variables so that register allocator does not generate unnecessary spill codes.}, pages = {71--80}, title = {依存グラフを用いてアーキテクチャ独立な最適化と対象計算機の資源制約を調整する手法}, volume = {42}, year = {2001} }