5H-04>?=LCDFGMIOBJNPRSHIK@AEDQUTYX [^, V\ _`, c4 d5, ]Z 7W
fhato, iizuka, sakai, tanakag@mtl.t.u-tokyo.ac.jp

eg_a_a6 bahif8 3ojqmv ¥¦ªËô3"Ç ­Ëô3"Ì'Ü4¸2¥¦ª<LÌ7ÇNÐÅ3É<LÊÉÃÅ°Ù3ÑÁ ALU ÉÈË§Ç'ÉØ2­45§ÌYM.µB&ÆÌÉ°ÁÓ2ïäÔ¥¦ª<Lµ ­©¤híË¢«
ÇÉÙ¹ÇµAûºÚÙ3¹ËuÜn¸Å2¥¦ª<LË ÜÞ×½
ñ.Æ¯Ù¬ ­¦4¨®µ!ºÚÅ°Ù3¬ ­¦4¨®ÆÌ£®$öË{3ÜEC»2­4«[ ÉÈË¥¦ª[ Ü*dÊ¬[ Êxº¾Ù¹ÇÆ2¥¦ª<LÜõÞ½Ù37ëÆÌ2¹ÚÑÆ- ÆíÛÚÅ¶Á¬ ­¦4¨®Ü2- ,Æí±l_Ü!½Ù31

¹ÚÑÆË¬ ­¦4¨®Ël_Ì ¶· 2mÊXKºÚ2 (1) «4 ¡4Ë ­¦4¨®
(2)Partial Redundancy Elimination Ü/7Ç»Á ­¦4¨®µ5ó½Ù3
ùi [1] Ì- Ê.ÑÚÙ«4 Ëê0Ü
f»2(2Ç»Á¥¦ªÜ«4 Ë&1Ï(½Ù ( 1)3«4 Ê alias ´È±´µX´×É°¥¦ªÕ2- âÎp»µ¯Ù~îÌ¿ËùäÊ load/store Üü»Å24Ë~Ü]
z½Ù ( 2)3
äi [2] Ì Partial Redundancy Elimination Ü¥¦ªÊ9»Åí±ÔËÆ2«4 ê0µÉ°~îÆÔ}É load/store Üõv½Ù3r = *gr = *gr++*g = rr++*g = r 1: rÉ«4 Ë ­¦4¨®
(g Ì Global [ Ë¬)r = *gr = *gr++*g = r

F( )r++

ì§Ùìí
¶8îÌË

2*g = rF( )r = *g*g = r 2: $öTI)Ü.Ò ­¦4¨®
(1) £®$ö (2) 4[y (3) ­¦4¨®w,ñ. Ë 3 ÄËsF´×ÉÙ3"-Ê¿ÚÀÚÊÄ
°Åø=½Ù3l¥¦ªÜ¬Ê[+Æ¶Ùw,( ­¦4¨®w,) ÜÐÙÁÓÊ2 context sensitive É£®$öÜí±3<Lµ½Ù¬µÛ´ÚÍ2 ­¦4¨®µ2ÉÁÓ2ñ
­¦4¨®w,ËoÌ2©©ª4«Ë$ö
TÉ- âÎp»Õ2#5-xµ¡8É store Æ¯
Ù3 (7ëËÌ2>´¸VXµ ­¦4¨®w,Üe»Å°Ù)
3.1

context sensitiven9¹ÚÑÆË|tÆÌ2 ­¦4¨®Ë$Ü- Êá»Å°Áµ2- ,Æ ­¦4¨®Üí²Í Call
By Reference Ü¬ÜC°Åí±¹Çµ2ÊÉ
3.2
¥§
Ù ( 3, 4, 5)3ÑÁ2­4«[ ÜC°Á- ,w,Ë¥¦ªÌ¬Ê[+½ÊÔ¬ÜC°Ù¹ÇµÆ¶Ù3¿¹Æ27ë
Ù3ÁÂ»ñ.ùÇ¼{3Ü]z½ÙÁÓ2w,Ë
ÆÌ- ,¬ ­¦4¨®Ü!½Ù37l_çÊ load2w,ËpçÊ store Üü½Ù3 (w,µ3 \Memory Access Elimination by Interprocedural Register Pro¥¦ª[Ë scope oÜ.Ò~îÊÌ2 store ÌTmotion"DÆ¯Ù3) ÑÁ2w,Æ¯ÃÅÔ#5-xµ¡8ÉNaoya Hattori, Daisuke Iizuka, Shuichi Sakai, Hidehiko TanakaloadËùÊÌ store µPDÊÉÙ3
University of Tokyo, Graduate School of Engineering,­¦4¨®w,µ- âÎp»Üã°Æ°Ù~î
7-3-1 Hongo, Bunkyo-ku, Tokyo 113-8656, Japan3Ì2ñË[ BÜ- ,Æ!²ÙÁÓÊ+ 5\Ü1½ÙPDµ¯Ù3ÁÂ»2 callee 1"-Æ ­¦4¨®9{Ë load µÉ°~îÌ+ Ü1½ÙP
DÌÉ·2 callee "-Æ9{ store µÉ°~îÌ\Ü1½ÙPDÌÉ°3 3 6 4, 4 6 5 ÆÌ¿ÚÀÚ
callee µ load/store Ü.ÝÆ°ÙËÆ2+ 5\Ü
1»Å°Ù (TDÊÉÃÁ+ ËõvÔíÃÅ°Ù)3¦n¬:
3.1, 3.2 ÑÆËsFÆ ­¦4¨®Üí±¹ÇÌ2Æ¯Ùµ2@ µ¼Ù¹Çµ¯Ù3ñ w,Æ ­¦4¨®Üí±Ç2ZË«4 ËÊ<LÜ»Åµ-»Å»Ñ±2µ¯Ù ( 6 ð)3
ÑÁ2;%9Ê- Ë+ 5\Üÿ1º¾Å»Ñ±2
Ô¯Ù3¿ËÁÓ2w,ËoÜ.Ò«4 ÕÆÌ¿ËI)Ü ­¦4¨®w,Ê.ÒÐ¶´Ü2­¦4¨®ùäË [.´×½Ù ( 6,µñÉw,Æ¯Ù)3
3.3

void F(int* p, int* q)
int a,b*(&a)=…
*(&b)=…
F(&a, &b)

t=*p
s=*q
*q=t
*p=s
ret

…=*(&a)…=*(&b)

int a,bx=…
*(&b)=…
(x)=F(x, &b)

t=u
s=*q
*q=t
u=s
ret (u)…=x…=*(&b)

 3: step0:­¦4¨®ù(int, int) F(int u, int v)
int a,bx=…
y=…
(x, y)=F(x, y)(int) F(int u, int* q)

t=u
s=v
v=t
u=s
ret (u, v)…=x…=y 5: step2:
q Ü promotion »Á{3p 4: step1:
Ü promotion »Á{3AABBCCDD

ä:o-> 6: w,ñ.

»¼Â
»¼º

promotion
promotion
promotion

½µ±¾´
µ±¾´

load

±³¶¹¼

store

±³¶¹¼

11,059,791,308

4,445,175,523-2,578,523,330-13,145,816-3,204,519,361-14,100

R 1: compress95 Ë ­¦4¨®{3[ Ç­4«[ úÅµ¥¦ªÊ´ÚÅ°Ù3¹
Ë4Ê9»2- 2- ,¿ÚÀÚË ­¦4¨®ÜC»Á3
J ­©¤Ç»ÅÌ SPECint95 Ë compress95
ÜaC»Á3{3ÜR 1 Êe½3compress95 Ì ­4«[ ÜC°Áz`µ8°
ÁÓ2 load Ê-»ÅÌ- , ­¦4¨®Ëæ3µßÚÅ°Ù3*^2 store Ë µÿ²Å»ÑÃÁËÌ2ñ w,Æ ­¦4¨®ÜíÃÅ³Ø2Z«4 ÊÜ1»Å»ÑÃÁÁÓÆ¯Ù3pkqk«©n<7ëÆÌ2¥¦ªÜõÞ½Ùñ.Æ¯Ù¬ ­¦4¨®Üy#»2¹ÚÜ- ,Ê'½
Ùl_ÊÄ°ÅqÐÁ3ÑÁ2¹Ël_ÜC°ÁõÞHÜ}÷ÔÙÁÓ2 compress95 Ê-»ÅAOS0ÜíÃÁ3ïäÌ2«ª¤Ë:hþVXÜýsÊhþ»2!l_ÊÖÙ(É õÞÜS0½Ù¹ÇµPDÆ¯Ù3ÑÁ2ß%ÆÌ¬Ì;áÊa²Ù
Ç°±/Ü°Å°Ùµ2WF¬ ÊáÜ1²ÁdËS0Ôí±PDµ¯ÙÇì²Å°Ù35

ÅÄ7|tÜÓÙÊ¯ÁØ2Ub|ttËw éc2?6è2cÊÌ®©rÎ0ÉåuàÜ¶Ñ»Á3·*j»Ñ½3
Ãª¤¨
[1]

A.V.S. Sastry and Roy D.C. Ju.

A New Algorithm forScalar Register Promotion Based on SSA From.

PLDI,pp. 15{25, 1998.

­¢£;7ëgQd Æ2|1«ª¤hþÌ)G»Å°
É°3»´»AOS0Ç»Å2ñ w,Æ ­¦4¨®ÜíÃÁ~îË Ë[.ÜÐÁ3hþÌUb|ttË C ®© [3] Ë RIC ,
4Ê9»ÅíÃÅ°Ù3¹Ë,4Ì¬;á ¦«ÜòC»Å³Ø2+ 5\Ë ÔáµÉ°3ñ.ùË4ÆÌ2¬Ük×ÚÅ°Ù

[2]

4Raymond Lo¿.

A New Algorithm for Scalar Register

Promotion Based on SSA From.
[3]

PLDI, pp. 26{37, 1998.

ÆÇ À¸ ¿ ÊÏËÉÍ°®¯²ÎÐÌ·È ±ÑÁ HPC. C77, pp. 65{70, 1999.

.