{"id":15101436,"url":"https://github.com/lucaanza/myfirstllvm_compiler","last_synced_at":"2026-03-08T01:35:01.343Z","repository":{"id":221542496,"uuid":"753714940","full_name":"lucaAnza/MyFirstLLVM_compiler","owner":"lucaAnza","description":"Creating a Compiler for the Kaleidoscope Programming Language using LLVM16.","archived":false,"fork":false,"pushed_at":"2024-07-08T16:35:34.000Z","size":36336,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"Step1","last_synced_at":"2025-02-08T01:33:09.347Z","etag":null,"topics":["bison","compiler","flex","kaleidoscope","llvm"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucaAnza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-06T16:55:31.000Z","updated_at":"2024-07-08T16:35:37.000Z","dependencies_parsed_at":"2024-07-08T20:44:28.787Z","dependency_job_id":null,"html_url":"https://github.com/lucaAnza/MyFirstLLVM_compiler","commit_stats":{"total_commits":129,"total_committers":2,"mean_commits":64.5,"dds":0.03100775193798455,"last_synced_commit":"52b1227faa0b55da278f2ab52bce17e3c34c9ef7"},"previous_names":["lucaanza/myfirstllvm_compiler"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaAnza%2FMyFirstLLVM_compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaAnza%2FMyFirstLLVM_compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaAnza%2FMyFirstLLVM_compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaAnza%2FMyFirstLLVM_compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucaAnza","download_url":"https://codeload.github.com/lucaAnza/MyFirstLLVM_compiler/tar.gz/refs/heads/Step1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241970956,"owners_count":20050751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bison","compiler","flex","kaleidoscope","llvm"],"created_at":"2024-09-25T18:23:01.694Z","updated_at":"2025-12-06T01:02:19.778Z","avatar_url":"https://github.com/lucaAnza.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# My First LLVM Compiler\n\nIn this repository you can find the implementation of a compiler. \u003cbr\u003e\nThe compiler is divided into \u003cb\u003eFront-End\u003c/b\u003e and \u003cb\u003eMiddle-End\u003c/b\u003e. \u003cbr\u003e\nThe \u003cb\u003eBack-End\u003c/b\u003e part is not implemented 🚫 \n\n\n## Introduction\n\n### What is the purpose of a compiler?\n\nA compiler translates code written in a high-level programming language into machine code that a computer can understand. In more detail, a compiler is a special type of software that serves as a translator between the programmer and the computer.\n\n\n### Anatomy of a compiler\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cimg src=\"Front-End/Teoria/img/toolchain.png\"\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003cimg src=\"Front-End/Teoria/img/istruction_translate.png\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n\n### Compiler toolchain\n\n\u003cimg src=\"Front-End/Teoria/img/toolchain2.png\"\u003e\u003c/td\u003e\n\n\u003cbr\u003e\n\n## Dependencies ⚙️\nThe Front-End and Middle-End have different versions of LLVM and different dependencies. \u003cbr\u003e\n- Each project directory contains a \u003cspan style=\"color:orange\"\u003eREADME.md\u003c/span\u003e file that specifies the requirements.\n\n\u003cbr\u003e\n\n## Middle-end 📁\n\nIn this directory you can find some optimizations on IR Code.\u003cbr\u003e\nEach optimization is made modifying LLVM source code or creating a new pass.\u003cbr\u003e\n\u003cbr\u003e\n\n_middle-end function:_\n\n\u003cimg src=\"Back-End/Slide/img/compiler_anatomy.png\" width=50%\u003e\u003c/img\u003e\n\n\u003cimg src=\"Back-End/Slide/img/compiler_anatomy2.png\" width=50%\u003e\u003c/img\u003e\n\n---\n\n### Which optimizations or analysis?\n\n#### Assignment1(optimization-LLVM)\n\n- Algebric Identity.\n- Strengh Reduction.\n- Multi Instructions opt.\n\n#### Assignment2(analiysis)\n\n-\u003eData Flow Analysis on three different case:\n\n- Constant Propagation.\n- Dominator Analysis.\n- Very Busy Expressions.\n\n#### Assignment3(optimization-LLVM)\n\n- LICM (Loop Invariant Code Motion).\n\n#### Assignment4(optimization-LLVM)\n\n- LI (Loop Fusion).\n\n\u003cbr\u003e\u003cbr\u003e\n\n## Front-End 📁\n\nGiven the following compilation stages:\n\n\u003cimg src=\"Front-End/Teoria/img/toolchain.png\" alt=\"fasi\" width=30%\u003e\u003c/img\u003e\n\nIn this part of the project, we will analyze and produce a working example of the first 4 phases (Front-End).\nThe phases are as follows:\n\n1. Lexical analyzer.\n2. Syntax analyzer.\n3. Semantic analyzer.\n4. Intermediate code generator.\n\n\u003cbr\u003e\n\n\u003cb\u003eFront-End structure\u003c/b\u003e\n\n\u003cimg src=\"Front-End/Progetto_Finale/img/struttura_front-end.png\" alt=\"explain img\" width=50%\u003e\n\n- \u003cb\u003eLexer\u003c/b\u003e is implemented using [Flex](https://github.com/westes/flex) (open source tool)\n- \u003cb\u003eParser\u003c/b\u003e is implemented using [Bison](https://www.gnu.org/software/bison/) (open source tool)\n- \u003cb\u003eCode generator\u003c/b\u003e is implemented in a file .cpp called `driver.cpp`.\n\n\n\u003cbr\u003e\u003cbr\u003e\n\nℹ️ More details of the programming language implemented is on `/Front-End/Progetto_finale/`\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucaanza%2Fmyfirstllvm_compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucaanza%2Fmyfirstllvm_compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucaanza%2Fmyfirstllvm_compiler/lists"}