Computer Science ›› 2020, Vol. 47 ›› Issue (6A): 561-566.doi: 10.11896/JsJkx.191100017

• Interdiscipline & Application • Previous Articles     Next Articles

Node Fusion Optimization Method Based on LLVM Compiler

HU Hao1, SHEN Li2, 3, ZHOU Qing-lei1 and GONG Ling-qin1   

  1. 1 School of Information Engineering,Zhengzhou University,Zhengzhou 450000,China
    2 School of Computer Science and Technology,University of Science and Technology of China,Hefei 230000,China
    3 Wuxi Jiangnan Computer Technology Research Institute,Wuxi,Jiangsu 214083,China
  • Published:2020-07-07
  • About author:OSMIALOWSKI P.How The Flang Frontend Works:Introduction to the interior of the Open-Source Fortran frontend for LLVM//Proceedings of the Fourth Workshop on the LLVM Compiler Infrastructure in HPC.ACM, 2017:1.
    HU Hao, born in 1994, postgraduate.His main research interests include information security.
  • Supported by:
    This work was supported by the National Natural Science Foundation of China (61572444).

Abstract: LLVM is a framework system of architecture compiler written in C++,which is a cross-compiler that supports multiple back-ends.It can optimize program compilation time,link time,run time,and idle time.Node fusion is a simple and effective optimization method.The basic idea is to optimize multiple nodes into an efficient fusion node.This optimization can reduce overhead such as instructions,registers,clock cycles,memory access,so as to reduce program running time and improve memory access efficiency.In order to improve the performance of the LLVM compiler,node fusion optimization algorithm is proposed for the LLVM compiler in the intermediate presentation phase,DAG combine phase and instruction selection phase.Under the domestic platform Sunway processor,with CLANG and FLANG as the front end and LLVM as the back end of the compiler,LLVM is evaluated based on the SPEC CPU2006 test set.The results show that node fusion optimization is beneficial to improve compiler performance and reduce program running time.The optimized maximum speedup ratio is 1.59 and the average speedup ratio is 1.13.

Key words: DAG combine, Domestic platform, Instruction selection, Intermediate representation, LLVM, Node fusion

CLC Number: 

  • TP311
[1] LATTNER C.LLVM and Clang:Next generation compiler technology//The BSD Conference.2008,5.
[2] LATTNER C,ADVE V.LLVM:A compilation framework for lifelong program analysis & transformation//Proceedings of the International Symposium on Code Generation and Optimization:Feedback-directed and Runtime Optimization.IEEE Computer Society,2004:75.
[3] ZHAO J,NAGARAKATTE S,MARTIN M M K,et al.Formalizing the LLVM intermediate representation for verified program transformations//Acm Sigplan Notices.ACM,2012,47(1):427-440.
[4] PANDEY M,SARDA S.LLVM cookbook.Packt Publishing Ltd.,2015.
[5] FRASER C W.A compact,machine-independent peephole optimizer//Proceedings of the 6th ACM SIGACT-SIGPLAN symposium on Principles of programming languages.ACM,1979:1-6.
[6] SPRADLING C D.SPEC CPU2006 benchmark tools.ACM SIGARCH Computer Architecture News,2007,35(1):130-134.
[7] GUOBIN Y E.Getting to know the LLVM compiler.Master’s thesis,The University of Edinburgh,2011.
[8] LATTNER C.Introduction to the llvm compiler infrastructure//Itanium Conference and Expo.2006.
[9] PANDEY M,SARDA S.LLVM cookbook.Packt Publising Ltd,2015.
[10] CYTRON R,FERRANTE J,ROSEN B K,et al.Efficiently computing static single assignment form and the control dependence graph.ACM Transactions on Programming Languages and Systems (TOPLAS),1991,13(4):451-490.
[11] CALLAHAN D,COOPER K D,KENNEDY K,et al.Interprocedural constant propagation//ACM SIGPLAN Notices.ACM,1986,21(7):152-161.
[12] COCKE J.Global common subexpression elimination.ACM Sigplan Notices,1970,5(7):20-24.
[13] LATTNER C,ADVE V.The LLVM instruction set and compi-lation strategy.CS Dept.,Univ.of Illinois at Urbana-Champaign,Tech.Report UIUCDCS,2002.
[14] HOKENEK E,MONTOYE R K,COOK P W.Second-generation RISC floating point with multiply-add fused.IEEE Journal of Solid-State Circuits,1990,25(5):1207-1213.
[1] LIU Dan, GUO Shao-zhong, HAO Jiang-wei, XU Jin-chen. Implementation of Transcendental Functions on Vectors Based on SIMD Extensions [J]. Computer Science, 2021, 48(6): 26-33.
[2] CHEN Tao, SHU Hui, XIONG Xiao-bing. Study of Universal Shellcode Generation Technology [J]. Computer Science, 2021, 48(4): 288-294.
[3] HU Wei-fang, CHEN Yun, LI Ying-ying, SHANG Jian-dong. Loop Fusion Strategy Based on Data Reuse Analysis in Polyhedral Compilation [J]. Computer Science, 2021, 48(12): 49-58.
[4] ZHANG Qi-liang, ZHANG Yu and ZHOU Kun. CCodeExtractor:Automatic Approach of Function Extraction for C Programs [J]. Computer Science, 2017, 44(4): 16-20.
[5] WANG Tao, HAN Lan-sheng, FU Cai, ZOU De-qing and LIU Ming. Static Detection Model and Framework for Software Vulnerability [J]. Computer Science, 2016, 43(5): 80-86.
[6] CHEN Xiang,SHEN Li,LI Jia-wen. Automatic Data Permutation Generation and Optimization for SIMD Devices [J]. Computer Science, 2011, 38(5): 290-294.
[7] TIAN Shuo, LIANG Hong-liang. Survey of Static Analysis Methods for Binary Code Vulnerability [J]. Computer Science, 2009, 36(7): 8-14.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!