Skip to content
forked from Azurewyl/llvm_upt

llvm backend for upt, a self-defined cpu

License

Notifications You must be signed in to change notification settings

zbs4017/llvm_upt

 
 

Repository files navigation

[toc]

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further assistance with LLVM, and in particular docs/GettingStarted.rst for getting started with LLVM and docs/README.txt for an overview of LLVM's documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our suggestions.

UPT Backend

This is a simple example LLVM backend for an UPT architecture - An self define CPU for my master degree thesis

Build and Usage

todo

LLVM运行测试说明文档

Instruction Set Architecture

Target-independent Code Generator

todo

Summary

Implementation detail

todo

Regression Test

todo

Materials

I will update some practical videos and documentation for the development of the compiler backend

Except for those related to code generation algorithms such as instruction selection and register allocation,there are few papers involved here, as most of them are not practical

A good place is [llvm dev mailing list],you can find answers for those tricky problem in practical banckend development

Hopefully it will help you

LLVM Introduction

2019 LLVM Developers’ Meeting: J. Paquette & F. Hahn “Getting Started With LLVM: Basics”

2019 LLVM Developers’ Meeting: E. Christopher & J. Doerfert “Introduction to LLVM”

Bud17-302 LLVM Internals #2

TableGen

llvm doc

http://llvm.org/docs/TableGen/index.html

http://llvm.org/docs/TableGen/LangIntro.html

Important Data Structure in Backend

IR

http://llvm.org/devmtg/2019-04/slides/Tutorial-Bridgers-LLVM_IR_tutorial.pdf

MI Layer

The LLVM Machine Representation

MC-Layer

http://blog.llvm.org/2010/04/intro-to-llvm-mc-project.html

https://www.embecosm.com/appnotes/ean10/ean10-howto-llvmas-1.0.html

Backend Tutriol

llvm doc

http://llvm.org/docs/CodeGenerator.html

https://llvm.org/docs/WritingAnLLVMBackend.html

Tutorial: Creating an LLVM Backend for the Cpu0 Architecture

Lectures

https://github.com/FrozenGene/presentation/blob/master/pdf/LLVM.pdf

https://www.cs.cmu.edu/afs/cs/academic/class/15745-s11/public/lectures/

https://lagunita.stanford.edu/login?next=/courses/Engineering/Compilers/Fall2014/course

Instruction Selection

paper or book

Instruction selection: principles, methods, and applications

GlobalIsel

2016 LLVM Developers’ Meeting: A. Bougacha & Q. Colombet & T. Northover “Global Instr.."

GlobalISel - LLVM's Latest Instruction Selection Framework

2017 LLVM Developers’ Meeting: “GlobalISel: Past, Present, and Future ”

Instruction Sechedule 指令调度

Basic concept

https://en.wikipedia.org/wiki/Instruction_scheduling

Lecture-pdf

https://engineering.purdue.edu/~milind/ece468/2015fall/lecture-08-6up.pdf

https://www.cl.cam.ac.uk/teaching/2005/OptComp/slides/lecture14.pdf

http://infolab.stanford.edu/~ullman/dragon/w06/lectures/inst-sched.pdf

Meeting videos

2017 LLVM Developers’ Meeting: “Writing Great Machine Schedulers ”

LLVM dev mail lists

http://llvm.org/devmtg/2012-11/Larin-Trick-Scheduling.pdf

https://llvm.org/devmtg/2014-10/Slides/Estes-MISchedulerTutorial.pdf

Very good videos

LLVM Instruction Scheduling (MI Scheduler)

LLVM pre-RA Scheduler

Latency Calculation in Instruction Scheduling

Register Allocation

llvm blog

http://blog.llvm.org/2011/09/greedy-register-allocation-in-llvm-30.html

good videos

Register Coalescer in LLVM

Slot Index, Live Range, and Live Interval

LLVM Register Pressure

Introduction to SSA

2018 LLVM Developers’ Meeting: M. Braun “Register Allocation: More than Coloring”

Paper

Linear Scan register allocation for the Java HotSpot client compiler

Code Emission

Some concept

https://en.wikipedia.org/wiki/Linker_(computing)#Relocation

good videos

Relaxation in Debug Information

Backend Test

http://llvm.org/docs/TestingGuide.html

2019 LLVM Developers’ Meeting: Homerding & Kruse “Getting Started with the LLVM Testing Infra..”

https://llvm.org/docs/CommandGuide/FileCheck.html

Other Backends

2018 LLVM Developers’ Meeting: A. Bradbury “LLVM backend development by example (RISC-V)”

2019 LLVM Developers’ Meeting: A. Bradbury “Maturing an LLVM backend: Lessons learned from the...”

https://reup.dmcs.pl/wiki/images/7/7a/Tricore-llvm-slides.pdf

llvm riscv backend commit patches

Leon llvm backend Goldberg C J. The Design of a Custom 32-bit RISC CPU and LLVM Compiler Backend[J], 2017.

Other articals

Parameter Passing

https://courses.cs.washington.edu/courses/cse410/09sp/examples/MIPSCallingConventionsSummary.pdf

Parameter (computer programming)

http://user.it.uu.se/~kostis/Teaching/KT1-11/Slides/handout13.pdf

LLVM:PowerPC assembly language tour

http://jonathan2251.github.io/lbd/funccall.html#dynamic-stack-allocation-support

variable-sized-objects-on-the-stack

About

llvm backend for upt, a self-defined cpu

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • LLVM 49.2%
  • C++ 30.6%
  • Assembly 19.1%
  • Python 0.4%
  • C 0.3%
  • CMake 0.2%
  • Other 0.2%