简体   繁体   English

为什么没有mem2reg不能通过优化?

[英]why optimizations passes doesn't work without mem2reg?

Why i have to do this mem2reg pass in bytecode optimization for obtaining another optimization pass result's? 为什么我必须在字节码优化中执行此mem2reg传递才能获得另一个优化传递结果? What's the use of mem2reg? mem2reg有什么用?

opt -dce myfile.bc

in this case i haven't changes in the output code 在这种情况下,我的输出代码没有变化

opt -mem2reg -dce myfile.bc

in this second case i have changes in the output code 在第二种情况下,我对输出代码进行了更改

edit: LLVR IR is still into SSa form, isn't it? 编辑:LLVR IR仍然是SSa形式,不是吗? using mem2reg i should have a "pruned" SSA form, is right? 使用mem2reg我应该有一个“修剪过的” SSA表格,对吗?

mem2reg pass converts non-SSA form of LLVM IR into SSA form, raising loads and stores to stack-allocated values to "registers" (SSA values). mem2reg pass将非SSA形式的LLVM IR转换为SSA形式,从而增加了负载并存储到堆栈分配的值中,并存储到“寄存器”(SSA值)中。 Many of LLVM optimization passes operate on the code in SSA form and thus most probably will be no-op seeing IR in non-SSA form. 许多LLVM优化过程都以SSA形式对代码进行操作,因此很可能是非操作性的非SSA形式的IR。

A bit more information is here: http://llvm.org/docs/Passes.html#mem2reg-promote-memory-to-register 此处提供了更多信息: http : //llvm.org/docs/Passes.html#mem2reg-promote-memory-to-register

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM