LLVM中级代表是什么? [英] What is LLVM Intermediate representation?

查看:122
本文介绍了LLVM中级代表是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试通过链接 http://llvm.org/demo/进行LLVM演示. 这是什么样的IR?是HIR,MIR还是LIR?我认为,SSA表示法通常用于MIR.那么,它是MIR吗?但是它可以存储信息以进行依赖性分析.因此,它可以是HIR吗?

I have tried the LLVM demo from the link http://llvm.org/demo/ What kind of IR is this? HIR, MIR or LIR? The SSA representation is usually used in MIR, I think. So, is it an MIR? But it can store the informations for dependence analysis. Hence can it be an HIR?

什么文件扩展名实际上代表LLVM IR,.ll或.bc?

What file extention actually represent the LLVM IR, .ll or .bc?

如何获取LLVM中使用的符号表?

How can I get the symbol table used in LLVM?

推荐答案

我不熟悉一个单一的 strict 定义,该定义将一个IR级别与另一个IR级别区分开,但是根据我的了解它会属于MIR类别.

I'm not familiar with a single, strict definition of what differentiates one level of IR from another, but from what I know it would fall under the MIR category.

  • 它具有SSA形式,并且没有显式的寄存器,因此我绝对不会将其归类为低级.
  • 它没有命名的子元素引用或高级流控制构造,因此也不适合HIR.

无论如何,LLVM IR通常以扩展名 .ll 的文本文件或扩展名 .bc 的二进制文件存储在磁盘上.两者之间的转换是微不足道的,您只需将llvm-dis用于 bc -> ll ,将llvm-as用于 ll -> bc .二进制格式的存储效率更高,而文本格式的可读性更高.

In any case, LLVM IR is typically stored on disk in either text files with .ll extension or in binary files with .bc extension. Conversion between the two is trivial, and you can just use llvm-dis for bc -> ll and llvm-as for ll -> bc. The binary format is more memory-efficient, while the textual format is human-readable.

这篇关于LLVM中级代表是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆