[hellogcc] Re: gccint-zh ch13.4 and ch13.5

  • From: 陳韋任 <chenwj@xxxxxxxxxxxxxx>
  • To: hellogcc@xxxxxxxxxxxxx
  • Date: Wed, 15 Feb 2012 20:50:50 +0800

  [...]

> +@en All statements that may define memory have exactly one accompanied
> +@en definition of a virtual SSA name using the previous state of memory
> +@en and defining the new state of memory after the given point in the IL.
> +
> +如果一个指令可能向内存中写数据,那么这个指令就对应一个虚拟SSA name的定
> 义,在IL中的给定点之前保持内存的先前状态,在该给定点之后被赋予新的值。

  以上大致沒問題。我好奇的是 IL 是代表 intermediate language 嗎?

> +
>  @smallexample
>  int i;
>  int foo (void)
> @@ -1099,73 +1105,103 @@
>  @}
>  @end smallexample
>  
> -The virtual SSA names in this case are @code{.MEM_2(D)} and
> -@code{.MEM_3}.  The store to the global variable @code{i}
> -defines @code{.MEM_3} invalidating @code{.MEM_2(D)}.  The
> -load from @code{i} uses that new state @code{.MEM_3}.
> +@en The virtual SSA names in this case are @code{.MEM_2(D)} and
> +@en @code{.MEM_3}.  The store to the global variable @code{i}
> +@en defines @code{.MEM_3} invalidating @code{.MEM_2(D)}.  The
> +@en load from @code{i} uses that new state @code{.MEM_3}.
>  
> -The virtual SSA web serves as constraints to SSA optimizers
> -preventing illegitimate code-motion and optimization.  It
> -also provides a way to walk related memory statements.
> +在这个例子中,vitrual SSA name分别是@code{.MEM_2(D)}和@code{.MEM_3}。全
> 局变量@code{i}对应的存储区定义了 @code{.MEM_3},同时使@code{.MEM_2(D)}无
> 效。(此后)从@code{i}加载使用的就是新状态 @code{.MEM_3}。
>  
> +@en The virtual SSA web serves as constraints to SSA optimizers
> +@en preventing illegitimate code-motion and optimization.  It
> +@en also provides a way to walk related memory statements.
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^
> +Virtual SSA web 用于对SSA相关优化的约束,防止不合法的代码移动和优化。同
> 时也可以用来遍历相关的指令。
                  ^^^^^^^^^^

  相關存取內存的指令,如何? 

>  @item Points-to and escape analysis.
>  
> -Points-to analysis builds a set of constraints from the GIMPLE
> -SSA IL representing all pointer operations and facts we do
> -or do not know about pointers.  Solving this set of constraints
> -yields a conservatively correct solution for each pointer
> -variable in the program (though we are only interested in
> -SSA name pointers) as to what it may possibly point to.
> +@item 指向分析和逃逸分析
>  
> -This points-to solution for a given SSA name pointer is stored
> -in the @code{pt_solution} sub-structure of the
> -@code{SSA_NAME_PTR_INFO} record.  The following accessor
> -functions are available:
> +@en Points-to analysis builds a set of constraints from the GIMPLE
> +@en SSA IL representing all pointer operations and facts we do
> +@en or do not know about pointers.  Solving this set of constraints
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

> +@en yields a conservatively correct solution for each pointer
> +@en variable in the program (though we are only interested in
> +@en SSA name pointers) as to what it may possibly point to.
>  
> +指向分析从GIMPLE SSA IL中提取有关指针的信息,建立一个包含所有指针的约束
> 集合。对约束集合的求解得到一个保守但是正确的解,计算出程序中的每一个指针
> 变量(虽然我们只对 SSA name指针感兴趣)可能指向的位置。

  我可能太吹毛求疵了。"and facts ..." 是刻意沒翻亦或是漏掉?

  [...]

> +@en @code{walk_non_aliased_vuses} walks over dominating memory defining
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^
> +@en statements and calls back if the statement does not clobber ref
> +@en providing the non-aliased VUSE.  The walk stops at
> +@en the first clobbering statement or if asked to.
> +
> +@code{walk_non_aliased_vuses}遍历所有支配的内存定义指令(dominating
> memory defining statements),根据non-aliased VUSE判断指令是否破坏了
> (clobber)ref。当遍历的指令没有破坏ref时进行回调(call back)。遍历在被
> (调用者)要求时或遇见第一个破坏了ref的指令时停止。

  編譯器裡面有所謂的 Dominator。這裡的 dominating 概念上跟 Dominator 一樣嗎?

> +@en @code{walk_aliased_vdefs} walks over dominating memory defining
> +@en statements and calls back on each statement clobbering ref
> +@en providing its aliasing VDEF.  The walk stops if asked to.
> +
> +@code{walk_aliased_vdefs}遍历所有支配的内存定义指令,当遇到破坏了
> (clobber)ref的指令时进行回调(根 据它的aliasing VDEF进行判断)。遍历在
> 被(调用者)要求时停止。

> @@ -1173,26 +1209,36 @@
>  @section Memory model
>  @cindex memory model
           ^^^^^^^^^^^^
             內存模型?

   [...]

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj

Other related posts: