1. Homepage
  2. Programming
  3. CS 415 Compilers - Project 3: Local Dead Code Elimination

CS 415 Compilers - Project 3: Local Dead Code Elimination

Engage in a Conversation
USRutgers UniversityCS 415CS415CompilersCAssemblyLocal Dead Code Elimination

CS 415: Compilers CourseNana.COM

Project 3: Local Dead Code Elimination

Due date: Wednesday, May 4 Clarifications and Modifications As project1 and project2, this is not a group project. CourseNana.COM

Project Description

You are asked to implement local (basic block) dead code elimination pass for ILOC programs. You may assume that values have unique register names, i.e., that the ILOC code follows the register-register model where register numbers are not reassigned. CourseNana.COM

The project is designed to be a stand-alone project, i.e., you don't need a solution of project 2 to work on project 3. However, you may choose to use your own infrastructure of project 1 to implement project 3 since both projects take ILOC instructions as input and generate ILOC instructions as output. Your optimizer needs to support the following ILOC instructions in the input code: CourseNana.COM

loadI, loadAI storeAI add, sub, mult outputAI Please note that the code provided to you supports more than these instructions, but your dead code elimination pass is only expected to be able to handle the above instructions. All test cases will be limited the above instructions. CourseNana.COM

Local dead code elimination identifies ILOC instructions that are executed in the basic block but do not contribute to the output of the program. A dead code elimination pass is often used in optimizing compilers as a "clean-up" optimization after other optimizations. CourseNana.COM

Dead Code Elimination Algorithm

The ILOC instruction sequence of the single basic block is read from a file into an internal representation. The provided code uses a doubly-linked list to represent the sequence of ILOC instructions of the basic block. Each instruction should have a "critical" flag. To start, all output instructions are flagged as critical. All instructions that contribute to the computation of the values of critical instructions are themselves marked critical. You may think of this process as chasing the true dependencies backwards through the basic block. Dependencies can either go through registers or through memory locations. CourseNana.COM

Dead code elimination does not change the relative order of instructions. Once the marking process reaches a fixed-point, i.e., no instruction needs to be added as critical any more, the optimized code can be generated. In sequential order, print out the instructions that are marked critical, ignoring those that are not marked. CourseNana.COM

Getting Started

C code is provided as a starting point for your project. You can use this code, but you may also choose to use your own programming infrastructure as in project 1. Remember that this infrastructure has to be available on the ilab cluster. CourseNana.COM

Please copy the files into your subdirectory of choice using the command cp -r ~uli/cs415/projects/proj3/students myProjectSubdirectory . You may modify the files for your project as you see fit. However, your dead code eliminator has to take an ILOC program as input on stdin and produce ILOC code as output on stdout: ./deadcode < input.iloc > output.iloc This is important since we will use an automatic grader. CourseNana.COM

You can generate an executable called deadcode by typing make . There are a few test programs in subdirectory "testcases". Please should design your own test cases as well. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
US代写,Rutgers University代写,CS 415代写,CS415代写,Compilers代写,C代写,Assembly代写,Local Dead Code Elimination代写,US代编,Rutgers University代编,CS 415代编,CS415代编,Compilers代编,C代编,Assembly代编,Local Dead Code Elimination代编,US代考,Rutgers University代考,CS 415代考,CS415代考,Compilers代考,C代考,Assembly代考,Local Dead Code Elimination代考,UShelp,Rutgers Universityhelp,CS 415help,CS415help,Compilershelp,Chelp,Assemblyhelp,Local Dead Code Eliminationhelp,US作业代写,Rutgers University作业代写,CS 415作业代写,CS415作业代写,Compilers作业代写,C作业代写,Assembly作业代写,Local Dead Code Elimination作业代写,US编程代写,Rutgers University编程代写,CS 415编程代写,CS415编程代写,Compilers编程代写,C编程代写,Assembly编程代写,Local Dead Code Elimination编程代写,USprogramming help,Rutgers Universityprogramming help,CS 415programming help,CS415programming help,Compilersprogramming help,Cprogramming help,Assemblyprogramming help,Local Dead Code Eliminationprogramming help,USassignment help,Rutgers Universityassignment help,CS 415assignment help,CS415assignment help,Compilersassignment help,Cassignment help,Assemblyassignment help,Local Dead Code Eliminationassignment help,USsolution,Rutgers Universitysolution,CS 415solution,CS415solution,Compilerssolution,Csolution,Assemblysolution,Local Dead Code Eliminationsolution,