<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>《通过实例理解Go内联优化》的评论</title>
	<atom:link href="http://tonybai.com/2022/10/17/understand-go-inlining-optimisations-by-example/feed/" rel="self" type="application/rss+xml" />
	<link>https://tonybai.com/2022/10/17/understand-go-inlining-optimisations-by-example/</link>
	<description>一个程序员的心路历程</description>
	<lastBuildDate>Wed, 25 Mar 2026 09:21:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>作者：liu</title>
		<link>https://tonybai.com/2022/10/17/understand-go-inlining-optimisations-by-example/#comment-7706</link>
		<dc:creator>liu</dc:creator>
		<pubDate>Fri, 30 Jun 2023 11:40:37 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=3685#comment-7706</guid>
		<description>原来如此</description>
		<content:encoded><![CDATA[<p>原来如此</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2022/10/17/understand-go-inlining-optimisations-by-example/#comment-7705</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Fri, 30 Jun 2023 04:56:25 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=3685#comment-7705</guid>
		<description>go tool compile xxx时用src/cmd/complie/main.go这个入口点。

以compile为例，这些文件会存在于这个下面：


// getToolDir returns the default value of ToolDir.   
func getToolDir() string {  
    return filepath.Join(runtime.GOROOT(), &quot;pkg/tool/&quot;+runtime.GOOS+&quot;_&quot;+runtime.GOARCH)    
}  

执行go tool compile时，实际执行的就是src/cmd/complie/main.go文件对应的compile二进制文件。</description>
		<content:encoded><![CDATA[<p>go tool compile xxx时用src/cmd/complie/main.go这个入口点。</p>
<p>以compile为例，这些文件会存在于这个下面：</p>
<p>// getToolDir returns the default value of ToolDir.<br />
func getToolDir() string {<br />
    return filepath.Join(runtime.GOROOT(), “pkg/tool/”+runtime.GOOS+”_”+runtime.GOARCH)<br />
}  </p>
<p>执行go tool compile时，实际执行的就是src/cmd/complie/main.go文件对应的compile二进制文件。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：liu</title>
		<link>https://tonybai.com/2022/10/17/understand-go-inlining-optimisations-by-example/#comment-7704</link>
		<dc:creator>liu</dc:creator>
		<pubDate>Thu, 29 Jun 2023 11:46:01 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=3685#comment-7704</guid>
		<description>我现在有点疑惑的是.go 执行run 等类似的命的入口点在src/cmd/go/main.go. 那么src/cmd/complie/main.go文件的是怎么用这个入口点的呢</description>
		<content:encoded><![CDATA[<p>我现在有点疑惑的是.go 执行run 等类似的命的入口点在src/cmd/go/main.go. 那么src/cmd/complie/main.go文件的是怎么用这个入口点的呢</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：liu</title>
		<link>https://tonybai.com/2022/10/17/understand-go-inlining-optimisations-by-example/#comment-7703</link>
		<dc:creator>liu</dc:creator>
		<pubDate>Wed, 28 Jun 2023 06:26:27 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=3685#comment-7703</guid>
		<description>看您的文章有很多收获,也解开了我很多疑问.自己要学的东西还很多,谢谢前辈</description>
		<content:encoded><![CDATA[<p>看您的文章有很多收获,也解开了我很多疑问.自己要学的东西还很多,谢谢前辈</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2022/10/17/understand-go-inlining-optimisations-by-example/#comment-7702</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Wed, 28 Jun 2023 05:11:57 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=3685#comment-7702</guid>
		<description>我也不是什么编译专家，多数也是挖代码，结合编译器的资料进行归纳总结:)

内联优化也是基于某种IR(中间表示)进行的。和expand call不同的是，内联通常在高层中间表示阶段进行。而expand call通常在低层中间表&gt;示阶段进行，比如SSA这种IR阶段进行。(编译过程有多种IR表示)

内联直白的说就是将调用某函数F的地方换成函数F的实现，至少可以去掉一层函数调用的开销。

而expand call(以SSA为例)具体学术含义我也没有深入研究过，它是SSA诸多passes的一个pass，其本身是optimize，还是为后续的optimize pass做铺垫尚不清楚，在Go编译器代码中注释如下：
                                                                                                             
// expandCalls converts LE (Late Expansion) calls that act like they receive value args into a lower-level form
// that is more oriented to a platform&#039;s ABI.  The SelectN operations that extract results are rewritten into
// more appropriate forms, and any StructMake or ArrayMake inputs are decomposed until non-struct values are
// reached.  On the callee side, OpArg nodes are not decomposed until this phase is run.</description>
		<content:encoded><![CDATA[<p>我也不是什么编译专家，多数也是挖代码，结合编译器的资料进行归纳总结:)</p>
<p>内联优化也是基于某种IR(中间表示)进行的。和expand call不同的是，内联通常在高层中间表示阶段进行。而expand call通常在低层中间表&gt;示阶段进行，比如SSA这种IR阶段进行。(编译过程有多种IR表示)</p>
<p>内联直白的说就是将调用某函数F的地方换成函数F的实现，至少可以去掉一层函数调用的开销。</p>
<p>而expand call(以SSA为例)具体学术含义我也没有深入研究过，它是SSA诸多passes的一个pass，其本身是optimize，还是为后续的optimize pass做铺垫尚不清楚，在Go编译器代码中注释如下：</p>
<p>// expandCalls converts LE (Late Expansion) calls that act like they receive value args into a lower-level form<br />
// that is more oriented to a platform&#8217;s ABI.  The SelectN operations that extract results are rewritten into<br />
// more appropriate forms, and any StructMake or ArrayMake inputs are decomposed until non-struct values are<br />
// reached.  On the callee side, OpArg nodes are not decomposed until this phase is run.</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：liu</title>
		<link>https://tonybai.com/2022/10/17/understand-go-inlining-optimisations-by-example/#comment-7701</link>
		<dc:creator>liu</dc:creator>
		<pubDate>Wed, 28 Jun 2023 02:45:23 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=3685#comment-7701</guid>
		<description>内联优化和IR优化中的expand calls 有什么区别的呢.小生刚开始看go的编译过程正好看到大佬的文章,所以有些疑问</description>
		<content:encoded><![CDATA[<p>内联优化和IR优化中的expand calls 有什么区别的呢.小生刚开始看go的编译过程正好看到大佬的文章,所以有些疑问</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2022/10/17/understand-go-inlining-optimisations-by-example/#comment-7646</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Mon, 17 Oct 2022 01:19:25 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=3685#comment-7646</guid>
		<description>感谢指出，稍后修改。</description>
		<content:encoded><![CDATA[<p>感谢指出，稍后修改。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bob</title>
		<link>https://tonybai.com/2022/10/17/understand-go-inlining-optimisations-by-example/#comment-7645</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Mon, 17 Oct 2022 01:14:36 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=3685#comment-7645</guid>
		<description>总结部分第一段中有个小笔误：函数内联决策的原谅你，应该为函数内联决策的原理。</description>
		<content:encoded><![CDATA[<p>总结部分第一段中有个小笔误：函数内联决策的原谅你，应该为函数内联决策的原理。</p>
]]></content:encoded>
	</item>
</channel>
</rss>
