当前位置:网站首页>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 单向链表中:

边栏推荐
- What's wrong with SD card data damage? How to recover SD card data damage
- 国产PC系统完成闭环,替代美国软硬件体系的时刻已经到来
- Basic syntax of class
- JS realizes the animation effect of text and pictures in the visual area
- Five elements of user experience
- Know that Chuangyu cloud monitoring - scanv Max update: Ecology OA unauthorized server request forgery and other two vulnerabilities can be detected
- 540. Single element in ordered array
- Causal AI, a new paradigm for industrial upgrading of the next generation of credible AI?
- How to connect WiFi with raspberry pie
- How to use kotlin to improve productivity: kotlin tips
猜你喜欢

The programmer went to bed at 12 o'clock in the middle of the night, and the leader angrily scolded: go to bed so early, you are very good at keeping fit

A outsourcing boy's mid-2022 summary

金仓KFS数据双向同步场景部署

Basic use of continuous integration server Jenkins

arthas watch 抓取入参的某个字段/属性

Daily question - ugly number

【毕业季·进击的技术er】职场人的自白

C language series - Section 3 - functions
![[NLP]—sparse neural network最新工作简述](/img/65/35ae0137f4030bdb2b0ab9acd85e16.png)
[NLP]—sparse neural network最新工作简述

Busycal latest Chinese version
随机推荐
When using the benchmarksql tool to test the concurrency of kingbasees, there are sub threads that are not closed in time after the main process is killed successfully
Two points -leetcode-540 A single element in an ordered array
Function introduction of member points mall system
Classes in TS
[dynamic programming] subsequence problem
Priv app permission exception
Basic types of data in TS
[NLP]—sparse neural network最新工作简述
RSRS index timing and large and small disc rotation
How do you use lodash linking function- How do you chain functions using lodash?
Factor stock selection scoring model
[untitled] 2022 safety production supervisor examination question bank and simulated safety production supervisor examination questions
[software testing-6] & Test Management
GFS distributed file system (it's nice to meet it alone)
sklearn数据预处理
Asp access teaching management system design finished product
Busycal latest Chinese version
The programmer went to bed at 12 o'clock in the middle of the night, and the leader angrily scolded: go to bed so early, you are very good at keeping fit
Prefix and (continuously updated)
Wine travel Jianghu War: Ctrip is strong, meituan is strong, and Tiktok is fighting