gcc 源碼分析--gimple 關鍵數據結構

gimple 操作碼,支持這些:

DEFGSCODE(GIMPLE_symbol, printable name, GSS_symbol). ?*/
DEFGSCODE(GIMPLE_ERROR_MARK, "gimple_error_mark", GSS_BASE)
DEFGSCODE(GIMPLE_COND, "gimple_cond", GSS_WITH_OPS)
DEFGSCODE(GIMPLE_DEBUG, "gimple_debug", GSS_WITH_OPS)
DEFGSCODE(GIMPLE_GOTO, "gimple_goto", GSS_WITH_OPS)
DEFGSCODE(GIMPLE_LABEL, "gimple_label", GSS_WITH_OPS)
DEFGSCODE(GIMPLE_SWITCH, "gimple_switch", GSS_WITH_OPS)
DEFGSCODE(GIMPLE_ASSIGN, "gimple_assign", GSS_WITH_MEM_OPS)
DEFGSCODE(GIMPLE_ASM, "gimple_asm", GSS_ASM)
DEFGSCODE(GIMPLE_CALL, "gimple_call", GSS_CALL)
DEFGSCODE(GIMPLE_TRANSACTION, "gimple_transaction", GSS_TRANSACTION)
DEFGSCODE(GIMPLE_RETURN, "gimple_return", GSS_WITH_MEM_OPS)
DEFGSCODE(GIMPLE_BIND, "gimple_bind", GSS_BIND)
DEFGSCODE(GIMPLE_CATCH, "gimple_catch", GSS_CATCH)
DEFGSCODE(GIMPLE_EH_FILTER, "gimple_eh_filter", GSS_EH_FILTER)
DEFGSCODE(GIMPLE_EH_MUST_NOT_THROW, "gimple_eh_must_not_throw", GSS_EH_MNT)
DEFGSCODE(GIMPLE_EH_ELSE, "gimple_eh_else", GSS_EH_ELSE)
DEFGSCODE(GIMPLE_RESX, "gimple_resx", GSS_EH_CTRL)
DEFGSCODE(GIMPLE_EH_DISPATCH, "gimple_eh_dispatch", GSS_EH_CTRL)
DEFGSCODE(GIMPLE_PHI, "gimple_phi", GSS_PHI)
DEFGSCODE(GIMPLE_TRY, "gimple_try", GSS_TRY)
DEFGSCODE(GIMPLE_NOP, "gimple_nop", GSS_BASE)
DEFGSCODE(GIMPLE_OMP_ATOMIC_LOAD, "gimple_omp_atomic_load",
DEFGSCODE(GIMPLE_OMP_ATOMIC_STORE, "gimple_omp_atomic_store",
DEFGSCODE(GIMPLE_OMP_CONTINUE, "gimple_omp_continue", GSS_OMP_CONTINUE)
DEFGSCODE(GIMPLE_OMP_CRITICAL, "gimple_omp_critical", GSS_OMP_CRITICAL)
DEFGSCODE(GIMPLE_OMP_FOR, "gimple_omp_for", GSS_OMP_FOR)
DEFGSCODE(GIMPLE_OMP_STRUCTURED_BLOCK, "gimple_omp_structured_block", GSS_OMP)
DEFGSCODE(GIMPLE_OMP_MASTER, "gimple_omp_master", GSS_OMP)
DEFGSCODE(GIMPLE_OMP_MASKED, "gimple_omp_masked", GSS_OMP_SINGLE_LAYOUT)
DEFGSCODE(GIMPLE_OMP_TASKGROUP, "gimple_omp_taskgroup", GSS_OMP_SINGLE_LAYOUT)
DEFGSCODE(GIMPLE_OMP_PARALLEL, "gimple_omp_parallel", GSS_OMP_PARALLEL_LAYOUT)
DEFGSCODE(GIMPLE_OMP_TASK, "gimple_omp_task", GSS_OMP_TASK)
DEFGSCODE(GIMPLE_OMP_RETURN, "gimple_omp_return", GSS_OMP_ATOMIC_STORE_LAYOUT)
DEFGSCODE(GIMPLE_OMP_SCAN, "gimple_omp_scan", GSS_OMP_SINGLE_LAYOUT)
DEFGSCODE(GIMPLE_OMP_SCOPE, "gimple_omp_scope", GSS_OMP_SINGLE_LAYOUT)
DEFGSCODE(GIMPLE_OMP_DISPATCH, "gimple_omp_dispatch", GSS_OMP_SINGLE_LAYOUT)
DEFGSCODE(GIMPLE_OMP_INTEROP, "gimple_omp_interop", GSS_OMP_SINGLE_LAYOUT)
DEFGSCODE(GIMPLE_OMP_SECTION, "gimple_omp_section", GSS_OMP)
DEFGSCODE(GIMPLE_OMP_SECTIONS, "gimple_omp_sections", GSS_OMP_SECTIONS)
DEFGSCODE(GIMPLE_OMP_SECTIONS_SWITCH, "gimple_omp_sections_switch", GSS_BASE)
DEFGSCODE(GIMPLE_OMP_SINGLE, "gimple_omp_single", GSS_OMP_SINGLE_LAYOUT)
DEFGSCODE(GIMPLE_OMP_TARGET, "gimple_omp_target", GSS_OMP_PARALLEL_LAYOUT)
DEFGSCODE(GIMPLE_OMP_TEAMS, "gimple_omp_teams", GSS_OMP_PARALLEL_LAYOUT)
DEFGSCODE(GIMPLE_OMP_ORDERED, "gimple_omp_ordered", GSS_OMP_SINGLE_LAYOUT)
DEFGSCODE(GIMPLE_PREDICT, "gimple_predict", GSS_BASE)
DEFGSCODE(GIMPLE_WITH_CLEANUP_EXPR, "gimple_with_cleanup_expr", GSS_WCE)
DEFGSCODE(GIMPLE_ASSUME, "gimple_assume", GSS_ASSUME)

/* Class of GIMPLE expressions suitable for the RHS of assignments. ?See
get_gimple_rhs_class. ?*/

enum gimple_rhs_class
{
GIMPLE_INVALID_RHS,?? ?/* The expression cannot be used on the RHS. ?*/
GIMPLE_TERNARY_RHS,?? ?/* The expression is a ternary operation. ?*/
GIMPLE_BINARY_RHS,?? ?/* The expression is a binary operation. ?*/
GIMPLE_UNARY_RHS,?? ?/* The expression is a unary operation. ?*/
GIMPLE_SINGLE_RHS?? ?/* The expression is a single object (an SSA
name, a _DECL, a _REF, etc. ?*/
};

gimple 操作指令基礎結構

struct?
gimple

{
/* [ WORD 1 ]
? ? ?Main identifying code for a tuple. ?*/
ENUM_BITFIELD(gimple_code) code : 8;

? /* Nonzero if a warning should not be emitted on this tuple. ?*/
unsigned int no_warning?? ?: 1;

? /* Nonzero if this tuple has been visited. ?Passes are responsible
for clearing this bit before using it. ?*/
unsigned int visited?? ??? ?: 1;

? /* Nonzero if this tuple represents a non-temporal move; currently
only stores are supported. ?*/
unsigned int nontemporal_move?? ?: 1;

? /* Pass local flags. ?These flags are free for any pass to use as
they see fit. ?Passes should not assume that these flags contain
any useful value when the pass starts. ?Any initial state that
the pass requires should be set on entry to the pass. ?See
gimple_set_plf and gimple_plf for usage. ?*/
unsigned int plf?? ??? ?: 2;

? /* Nonzero if this statement has been modified and needs to have its
operands rescanned. ?*/
unsigned modified ?? ??? ?: 1;

? /* Nonzero if this statement contains volatile operands. ?*/
unsigned has_volatile_ops ?? ?: 1;

? /* Padding to get subcode to 16 bit alignment. ?*/
unsigned pad?? ??? ??? ?: 1;

? /* The SUBCODE field can be used for tuple-specific flags for tuples
that do not require subcodes. ?Note that SUBCODE should be at
least as wide as tree codes, as several tuples store tree codes
in there. ?*/
unsigned int subcode?? ??? ?: 16;

? /* UID of this statement. ?This is used by passes that want to assign IDs
to statements. ?It must be assigned and used by each pass. ?By default
it should be assumed to contain garbage. ?*/
unsigned uid;

? /* [ WORD 2 ]
Number of operands in this tuple. ?*/
unsigned num_ops;

? /* Unused 32 bits padding on 64-bit hosts. ?*/

? /* [ WORD 3 ]
Locus information for debug info. ?*/
location_t location;

? /* [ WORD 4 ]
Basic block holding this statement. ?*/
basic_block bb;

? /* [ WORD 5-6 ]
Linked lists of gimple statements. ?The next pointers form
a NULL terminated list, the prev pointers are a cyclic list.
A gimple statement is hence also a double-ended list of
statements, with the pointer itself being the first element,
and the prev pointer being the last. ?*/
gimple *next;
gimple * prev;
}

繼續自gimple的各個不同指令結構的實現:

295: ?gimple_statement_with_ops_base : public gimple
311: ?gimple_statement_with_ops : public gimple_statement_with_ops_base
326: ?gimple_statement_with_memory_ops_base : public gimple_statement_with_ops_base
342: ? ?public gimple_statement_with_memory_ops_base
357: ?gcall : public gimple_statement_with_memory_ops_base
384: ?gimple_statement_omp : public gimple
396: ?gbind : public gimple
420: ?gcatch : public gimple
435: ?geh_filter : public gimple
451: ?geh_else : public gimple
462: ?geh_mnt : public gimple
473: ?gphi : public gimple
492: ?gimple_statement_eh_ctrl : public gimple
502: ?gresx : public gimple_statement_eh_ctrl
509: ?geh_dispatch : public gimple_statement_eh_ctrl
519: ?gtry : public gimple
549: ?gimple_statement_wce : public gimple
567: ?gasm : public gimple_statement_with_memory_ops_base
592: ?gomp_critical : public gimple_statement_omp
625: ?gomp_for : public gimple_statement_omp
648: ?gimple_statement_omp_parallel_layout : public gimple_statement_omp
667: ?gimple_statement_omp_taskreg : public gimple_statement_omp_parallel_layout
677: ?gomp_parallel : public gimple_statement_omp_taskreg
685: ?gomp_target : public gimple_statement_omp_parallel_layout
694: ?gomp_task : public gimple_statement_omp_taskreg
716: ?gomp_sections : public gimple_statement_omp
735: ?gomp_continue : public gimple
751: ?gimple_statement_omp_single_layout : public gimple_statement_omp
760: ?gomp_single : public gimple_statement_omp_single_layout
767: ?gomp_teams : public gimple_statement_omp_taskreg
774: ?gomp_ordered : public gimple_statement_omp_single_layout
781: ?gomp_scan : public gimple_statement_omp_single_layout
793: ?gomp_atomic_load : public gimple
805: ?gimple_statement_omp_atomic_store_layout : public gimple
815: ? ?public gimple_statement_omp_atomic_store_layout
823: ? ?public gimple_statement_omp_atomic_store_layout
832: ?gimple_statement_assume : public gimple
872: ?gtransaction : public gimple_statement_with_memory_ops_base
897: ?gcond : public gimple_statement_with_ops
908: ?gdebug : public gimple_statement_with_ops
918: ?ggoto : public gimple_statement_with_ops
928: ?glabel : public gimple_statement_with_ops
938: ?gswitch : public gimple_statement_with_ops
948: ?gassign : public gimple_statement_with_memory_ops
959: ?greturn : public gimple_statement_with_memory_ops

類型定義

typedef gimple *gimple_seq_node;

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/914545.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/914545.shtml
英文地址,請注明出處:http://en.pswp.cn/news/914545.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

TDengine GREATEST 和 LEAST 函數用戶手冊

TDengine GREATEST 和 LEAST 函數用戶手冊 1. 需求背景 1.1 問題描述 在實際生產過程中,客戶經常需要計算三相電流、電壓的最大值和最小值。傳統的實現方式需要使用復雜的 CASE WHEN 語句,例如: -- 傳統方式:計算三相電流最大…

Redis 與數據庫不一致問題及解決方案

一、不一致的原因分析 1. 緩存更新策略不當 先更新數據庫后刪除緩存:刪除緩存失敗會導致不一致 先刪除緩存后更新數據庫:并發請求可能導致不一致 緩存穿透:大量請求直接打到數據庫,繞過緩存 2. 并發操作問題 讀寫并發:讀請求獲取舊緩存時,寫請求更新了數據庫但未更新緩存…

iOS 加固工具使用經驗與 App 安全交付流程的實戰分享

在實際開發中,iOS App不僅要安全,還要能被穩定、快速、無誤地交付。這在外包、B端項目、渠道分發、企業自用系統等場景中尤為常見。 然而,許多開發者在引入加固工具后會遇到以下困擾: 混淆后App運行異常、不穩定;資源路…

Windows 下 Visual Studio 開發 C++ 項目的部署流程

在Windows環境中使用Visual Studio(以下簡稱VS)開發C項目時,“部署”是確保程序能在目標設備上正常運行的關鍵環節。部署的核心目標是:將編譯生成的可執行文件(.exe)、依賴的動態鏈接庫(.dll&am…

yolo8+聲紋識別(實時字幕)

現在已經完成了人臉識別跟蹤 ?,接下來要: ? 加入「聲紋識別(說話人識別)」功能,識別誰在講話,并在視頻中“這個人”的名字旁邊加上「正在講話」。 這屬于多模態識別(視覺 音頻)&a…

DH(Denavit–Hartenberg)矩陣

DH 矩陣(Denavit-Hartenberg 矩陣)是 1955 年由 Denavit 和 Hartenberg 提出的一種機器人運動學建模方法,用于描述機器人連桿和關節之間的關系。該方法通過在機器人每個連桿上建立坐標系,并用 44 的齊次變換矩陣(DH 矩…

Vim的magic模式

在 Vim 中,magic 模式用于控制正則表達式中特殊字符的解析方式。它決定了哪些字符需要轉義才能發揮特殊作用,從而影響搜索和替換命令的寫法。以下是詳細介紹: 一、三種 magic 模式 Vim 提供三種 magic 模式,通過在正則表達式前添加…

Git 使用技巧與原理(一)—— 基礎操作

1、起步 1.1 版本控制 版本控制是一種記錄一個或若干文件內容變化,以便將來查閱特定版本修訂情況的系統。 版本控制系統(VCS,Version Control System)通常可以分為三類: 本地版本控制系統:大多都是采用某…

軟件測試之自動化測試

目錄 1.什么是自動化測試 2.web?動化測試 2.1驅動 WebDriverManager 3. Selenium 3.1selenium驅動瀏覽器的?作原理 4.常用函數 4.1元素的定位 4.1.1cssSelector選擇器 4.2.2xpath 4.2操作測試對象 4.3窗? 4.4等待 4.5瀏覽器導航 4.6彈窗 4.7文件上傳 4.8設置…

sqlserver遷移日志文件和數據文件

sqlserver安裝后沒有指定日志存儲路徑或者還原庫指定的日志存儲位置不理想想要更改,都可以按照這種方式來更換;1.前提準備:數據庫的備份bak文件2.查看自己當前數據庫的日志文件和數據文件存儲路徑是否理想選中當前數據庫,右鍵屬性…

MFC UI表格制作從專家到入門

文章目錄CListCtrl常見問題增強版CGridCtrl(第三方)第三方庫ReoGridCListCtrl 默認情況下,CListCtrl不支持直接編輯單元格,需通過消息處理實現。 1.添加控件到資源視圖 在對話框資源編輯器中拖入List Control控件,設…

數字后端APR innovus sroute到底是如何選取寬度來鋪power rail的?

吾愛IC社區新一期IC訓練營將于7月初開班(07.06號晚上第一次直播課)!社區所有IC后端訓練營課程均為直播課!全網唯一一家敢開后端直播課的(口碑不好招生一定存在困難,自然就無法開直播課)&#xf…

LVS集群技術

LVS(Linux Virtual Server)是一種基于Linux內核的高性能、高可用性服務器集群技術,它通過負載均衡將客戶端請求分發到多臺后端真實服務器,實現 scalability 和 fault tolerance。LVS工作在傳輸層(OSI Layer 4&#xff…

git項目,有idea文件夾,怎么去掉

要從Git項目中排除.idea文件夾(IntelliJ IDEA的配置文件目錄),可以通過以下步驟操作: 1. 添加.gitignore規則 在項目根目錄創建或編輯.gitignore文件,添加以下內容: .idea/2. 從Git緩存中刪除已跟蹤的.idea…

springboot+swagger2文檔從swagger-bootstrap-ui更換為knife4j及文檔接口參數不顯示問題

背景 已有springboot項目,且使用的是swagger2+swagger-bootstrap-ui的版本 1.pom依賴如下 <!-- Swagger接口管理工具 --><dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger2</artifactId><version>2.9…

mysql數據庫表只能查詢,對于插入、更新、刪除操作一直卡住,直到報錯Lost connection to MySQL server during query

診斷步驟1. 查看阻塞進程SELECT * FROM performance_schema.metadata_locks WHERE LOCK_STATUS PENDING;SELECT * FROM sys.schema_table_lock_waits;2. 查看當前活動事務SELECT * FROM information_schema.INNODB_TRX;3. 查看進程列表SHOW PROCESSLIST;通過SELECT * FROM in…

Redis BigKey 深度解析:從原理到實戰解決方案

引言&#xff1a;什么是 BigKey&#xff1f;在 Redis 的使用場景中&#xff0c;BigKey&#xff08;大鍵&#xff09;是指那些數據量異常龐大的鍵值&#xff0c;通常表現為&#xff1a;String 類型&#xff1a;值大小超過 10KBHash/Set 等&#xff1a;元素數量超過 5000List/ZSe…

Qt 實現新手引導

Qt實現新手引導 對于一個新安裝的軟件或者一個新的功能&#xff0c;提供一個新手引導步驟&#xff0c;能夠讓用戶快速熟悉。這是最終效果&#xff0c;每一個按鈕都會有一個簡單引導&#xff0c;通過點擊上一步、下一步來切換不同的指導。當前引導的功能&#xff0c;會有一個高光…

Maven+Spring

一、Maven 相關- 本地倉庫設置&#xff1a;- 在 IDE&#xff08;如 IntelliJ IDEA&#xff09;中可以設置 Maven 的本地倉庫路徑&#xff0c;本地倉庫用于存儲從遠程倉庫下載的依賴庫&#xff0c;方便項目重復使用。- 倉庫關系&#xff1a;- 項目&#xff1a;開發中的項目&…

Android Handler 消息機制

常用場景&#xff1a; 子線程發送Message 主線程處理Message 子線程發送消息 public final boolean sendEmptyMessageDelayed(int what, long delayMillis) {Message msg Message.obtain();msg.what what;return sendMessageDelayed(msg, delayMillis);}public final boole…