当前位置:网站首页>MC Layer Target
MC Layer Target
2022-07-03 04:28:00 【Huo的藏经阁】
Target
每种类型的backends在MC成都会有一个对应Target类,位于llvm\include\llvm\MC\TargetRegistry.h文件。
- Target包含了对应backends的一些基础信息
- 每个backend都会有一个单实例Target
- Target除了包含一些最基本信息之外,另外一个重要用途:为创建MC层中各个类提供了createXXX接口,因此使用MC之前需要调用Target中createXX接口 按照需要创建相应MC组件
- 例如反汇编时需要调用createMCDisassembler,创建MCDisassembler进行反汇编。
Target 成员
Target 成员主要分为两个部分:基本信息成员以及各种回调函数
- 基本信息成员,例如const char *Name、const char *BackendName等等之类的。
- 各种回调函数Fn,例如MCAsmInfoCtorFn 等,XXXXFn以Fn为主主要为createXXXX接口创建相应MC中组件使用,
XXXXFn 需要在启动时调用相应registerXXX函数进行注册,TargetRegistry.h文件中提供了各种register函数 提供XXXFn注册功能。
TargetRegistry.h文件中还提供了各种creareXXXX函数,用于创建MC中各种组件。
FirstTarget
所有注册的backend Target最终会以单向链表形式串联起来:

FirstTarget 为第一个注册Target,查找某个Target时需要进行单向链表循环访问,目前由于backend不是很多,因此单向链表能够满足需求。
<Target>TargetInfo.cpp
新增一个后端时一般都会创建对应<Target>TargetInfo.cpp文件,用于提供对应Target类单实例以及注册功能
AMDGPU MC Target 注册功能位于llvm\lib\Target\AMDGPU\TargetInfo\AMDGPUTargetInfo.cpp文件中:

提供R600和GCN两个Target 单实例注册功能。
TargetRegistry::RegisterTarget
TargetRegistry::RegisterTarget最终会将单实例Target 注册到RegisterTarget 单向链表中:

边栏推荐
- [nlp] - brief introduction to the latest work of spark neural network
- [no title] 2022 chlorination process examination content and free chlorination process examination questions
- 跨境电商多商户系统怎么选
- Xrandr modifier la résolution et le taux de rafraîchissement
- Joint set search: merge intervals and ask whether two numbers are in the same set
- Jincang KFS data bidirectional synchronization scenario deployment
- Asp access teaching management system design finished product
- Busycal latest Chinese version
- [set theory] set concept and relationship (true subset | empty set | complete set | power set | number of set elements | power set steps)
- [set theory] set identities (idempotent law | exchange law | combination law | distribution rate | De Morgan law | absorption rate | zero law | identity | exclusion law | contradiction law | complemen
猜你喜欢

Employee attendance management system based on SSM

300+ documents! This article explains the latest progress of multimodal learning based on transformer

C language series - Section 3 - functions

The time has come for the domestic PC system to complete the closed loop and replace the American software and hardware system

Competitive product analysis and writing

FFMpeg filter

Which Bluetooth headset is good about 400? Four Bluetooth headsets with strong noise reduction are recommended

Feature_selection

Basic use of continuous integration server Jenkins

JS实现图片懒加载
随机推荐
【毕业季·进击的技术er】职场人的自白
因子选股-打分模型
Ffmpeg mix
Basic types of data in TS
[Thesis Writing] how to write the overall design of JSP tourism network
Taking two column waterfall flow as an example, how should we build an array of each column
Reptile exercise 02
PostgreSQL database high availability Patroni source code learning - etcd class
拆一辆十万元的比亚迪“元”,快来看看里面的有哪些元器件。
Php+mysql registration landing page development complete code
跨境电商多商户系统怎么选
Redis persistence principle
Small program animation realizes the running lantern and animation object
How to use kotlin to improve productivity: kotlin tips
Which Bluetooth headset is cost-effective? Four Bluetooth headsets with high cost performance are recommended
js实现在可视区内,文字图片动画效果
2022 electrician (Advanced) examination papers and electrician (Advanced) examination skills
金仓KFS数据双向同步场景部署
How to connect WiFi with raspberry pie
使用BENCHMARKSQL工具对kingbaseES执行灌数据提示无法找到JDBC driver