Preliminary Syllabus:
Spring 2021 EE 599/699
Optimizing Compilers

Instructor: Professor Hank Dietz
Office: 203 Davis Marksbury Building
Email: hankd@engr.uky.edu
Home URL: http://aggregate.org/hankd/ -- schedule and live office camera are posted there
Course URL: http://aggregate.org/OC
Course Meetings: TR 11:00-12:15 scheduled to meet live online via Zoom

Adjustments made to deal with COVID-19 are shown in RED.

All the software tools used in this course are available online, with most usable from any browser via a form interface. In-person meetings carry significant risk during the COVID-19 pandemic, so a variety of steps, discussed below, are being taken to minimize risk. The class videos are intended only for the personal use of students enrolled in the course; attending the class meetings live (in real time) is strongly preferred as long as available bandwidth, etc., permit. You also are encouraged to seriously consider the risks and benefits of meeting in-person with other students for study groups, etc. -- and if you do meet physically, be dilligent about taking appropriate precautions. Both Professor Dietz and the TA can be contacted via email to arrange "virtual office meetings" to discuss anything relevant to this course.

COVID-19 Class Meeting Issues

There are two sets of issues involving how class meetings will be handled during the pandemic. The following is copied, with only minor adjustment, from the University Senate Fall 2020 Academic Policies in Response to COVID-19, and the intent is that our course will generally be handled consistently with the latest guidelines posted there. Note that, at this writing, physical class meetings are not scheduled for this course; however, there may be various optional opportunities for physical meetings, so the following guidelines still apply.

Face Covering / Distancing Policy

Class Recording Notification

The University of Kentucky Student Code of Conduct defines Invasion of Privacy as using electronic or other devices to make a photographic, audio, or video record of any person without their prior knowledge or consent when such a recording is likely to cause injury or distress.

Meetings of this course may be recorded. All sections of the course are intended to share interactive participation in the same class meetings, independent of whether they are physically in the classroom or conducted via online media, thus, all sections are to be considered collectively as a single course for these purposes. All video and audio recordings of lecturers and class meetings, provided by the instructors, are for educational use by students in this class only. They are available only through the Canvas shell for this course or the course website, and are not to be copied, shared, or redistributed.

As addressed in the Student Code of Conduct, students are expected to follow appropriate university policies and maintain the security of linkblue accounts used to access recorded class materials. Recordings may not be reproduced, shared with those not enrolled in the class, or uploaded to other online environments.

If the instructor or a University of Kentucky office plans any other uses for the recordings, beyond this class, students identifiable in the recordings will be notified to request consent prior to such use. In anticipation of such cases, students may be asked to complete an "authorization of use" form by a faculty member.

Video and audio recordings by students are not permitted during the class unless the student has received prior permission from the instructor. Any sharing, distribution, and or uploading of these recordings outside of the parameters of the class is prohibited. Students with specific recording accommodations approved by the Disability Resource Center should present their official documentation to the instructor.

All content for this course, including handouts, assignments, and lectures are the intellectual property of the instructors and cannot be reproduced or sold without prior permission from the instructors. A student may use the material for reasonable educational and professional purposes extending beyond this class, such as studying for a comprehensive or qualifying examination in a degree program, preparing for a professional or certification examination, or to assist in fulfilling responsibilities at a job or internship.

Overview

Compilers are the software tools that translate high-level language constructs into something that can execute the desired operations. Normally, one thinks of compilers as straightforwardly translating programs written in langauges like C into assembly language code for something like a single simple processor. However, state-of-the-art compilers perform a wide range of optimizations, including various transformations that support parallel computer hardware ranging from simple pipleined processors to massively-parallel supercomputers. These same basic technologies also are used to create hardware, most often by translating hardware description language constructs into optimized digital circuits implemented using programmable logic.

This course presents the concepts needed to understand, design, and implement production quality compiler "back-ends" that target a wide range of computer architectures and various forms of programmable logic. Flow analysis and concurrency detection, as well as optimizations and loop and irregular code parallelizations, are covered in detail. The course is not limited to software targets, but also discusses compilation into hardware designs.

Grading will be based on two in-class exams and projects involving construction of optimizing, parallelizing, back-ends for one or more simple compilers which will be suppiled to the students as full C source code. Modifying the compiler for the project will require C programming. The project will be submitted online as source code and a short write-up.

The project and exam grades will be combined for your course grade such that (1) the project grade counts about as much as your exam grade and (2) your course grade is not more than one step above the lower of your project and exam grades.

GOALS:

To give students a better understanding of the intimate relationship between compiler techniques and computer architecture.

PREREQUISITE:

Undergraduate standing and fluency in C or a similar programming language

TOPICS:

  1. Introduction
  2. Basic code generation and optimization
  3. Analysis and transformation
  4. Silicon compilation and high-level logic synthesis
  5. Hardware acceleration and hardware/software codesign
  6. Project stuff

OUTCOMES:

Upon completion of this course the students should demonstrate the ability to:

  1. Understand the basic principles and techniques of compiler code generation for a wide range of computer architectures and programmable logic devices.
  2. Understand and be able to implement a variety of simple optimizations (e.g., peephole transformations) that do not require flow analysis.
  3. Understand and be able to implement Basic Block flow analysis, especially value numbering.
  4. Understand and be able to implement flow analysis based Basic Block optimizations including common subexpression elimination with value propagation and code scheduling.
  5. Understand and be able to implement at least one type of Global flow analysis.
  6. Understand and be able to implement flow analysis based Global optimizations including various types of loop transformations.

COMPUTER USAGE:

Students will perform open-ended experiments implementing analysis and optimization extensions to a simple compiler.

UNDERGRADUATE VS GRADUATE CONTENT:

Graduate students taking this course will be expected to include more, and more sophisticated, analysis and optimizations in their project than will be required for undergraduates. There are no other significant differences in workload or grading.

DESIGN CONTENT:

Students will design, implement, and test Basic Block and Global analysis and optimization transformations. There are many choices as to which analysis methods should be used, which transformations implemented, and how these abilities should be implemented. The target architecture will be a simple parallel system incorporating at least two different types of parallelism that the project compiler must target.

Policies and Ethics

Classroom attendance is expected: the course presentation makes heavy use of the lectures to convey the material, and quizes may be given at random in addition to the scheduled in-class exams. However, absences will be excused in accordance with Senate Rules 5.2.4.2 on excused absences. Additionally, at the discretion of the instructor, other absences often will be forgiven provided that the instructor or TA has been sent an email before the class period begins stating a reason for the absence. In the classroom, students should not take any actions that would disrupt the classroom environment (e.g., talking on a cell phone during class). In general, students are expected to behave in a respectful way towards their fellow students, the TA, and the instructor.

Students are expected to generally behave in an ethical manner, but violations will be treated as serious offenses. Altering graded exams and then submitting them for regrade is obviously unethical, but you do not need to be trying to enhance your grade in order for your behavior to be inappropriate. For example, attempts to break into computer accounts associated with this course or to falsely identify yourself are serious ethical violations even if there was no intent to "cheat" per se.

There are lots of study materials for this course, including old exams, widely available; using them as study aids is perfectly acceptable, but be warned that an apparent reuse of an old question usually has the question slightly reworded so that repeating the old answer will get no credit. Although students are encouraged to discuss course material with one another, everything you submit must be entirely your own original work. Similarly, for in-class exams that specify no textbooks, no calculators, etc., use of the banned resources is a serious offense.

University of Kentucky guidelines do not treat ethics violations as minor infractions. Violation of the policy can result in all involved students failing the course; more severe penalties also may be applied. Contact Professor Dietz beforehand if you have any doubts about how this policy might apply.

Generic Course Guidelines

The following standard UK course guidelines also apply to CPE380, except as noted above.

Midterm Grades for Undergraduate Students (Senate Rules 6.1.3.1)

Mid-term grades will be posted in myUK by the deadline established in the Academic Calendar.

Excused Absences (Senate Rules 5.2.4.2)

Senate Rules 5.2.4.2 defines the following as acceptable reasons for excused absences: (a) significant illness, (b) death of a family member, (c) trips for members of student organizations sponsored by an educational unit, trips for University classes, and trips for participation in intercollegiate athletic events, (d) major religious holidays, (e) interviews for graduate/professional school or full-time employment post-graduation, and (f) other circumstances found to fit "reasonable cause for nonattendance" by the instructor of record. Students should notify the professor of absences prior to class when possible.

If a course syllabus requires specific interactions (e.g., with the instructor or other students), in situations where a student's total EXCUSED absences exceed 1/5 (or 20%) of the required interactions for the course, the student shall have the right to request and receive a "W," or the Instructor of Record may award an "I" for the course if the student declines a "W." (Senate Rules 5.2.4.2.1)

(If an attendance/interaction policy is not stated in the course syllabus or the policy does not include a penalty to the student, the Instructor cannot penalize the student for any unexcused absences.)

Verification of Absences (Senate Rules 5.2.4.2.1 - 6)

Students may be asked to verify their absences in order for them to be considered excused. Senate Rule 5.2.4.2 states that faculty have the right to request appropriate verification when students claim an excused absence due to: significant illness; death in the household, trips for classes, trips sponsored by an educational unit and trips for participation related to intercollegiate athletic events; and interviews for full-time job opportunities after graduation and interviews for graduate and professional school. (Appropriate notification of absences due to University-related trips is required prior to the absence when feasible and in no case more than one week after the absence.)

Religious Observances (Senate Rules 5.2.4.2.4)

Students anticipating an absence for a major religious holiday are responsible for notifying the instructor in writing of anticipated absences due to their observance of such holidays. Please check the course syllabus for the notification requirement. If no requirement is specified, two weeks prior to the absence is reasonable and should not be given any later. Information regarding major religious holidays may be obtained through the Ombud's website or calling 859-257-3737.

Make-Up Work (Senate Rule 5.2.4.2)

Students missing any graded work due to an excused absence are responsible: for informing the Instructor of Record about their excused absence within one week following the period of the excused absence (except where prior notification is required); and for making up the missed work. The instructor must give the student an opportunity to make up the work and/or the exams missed due to the excused absence, and shall do so, if feasible, during the semester in which the absence occurred. The instructor shall provide the student with an opportunity to make up the graded work and may not simply calculate the student's grade on the basis of the other course requirements, unless the student agrees in writing.

Accommodations Due to Disability

If you have a documented disability that requires academic accommodations, please see me as soon as possible during scheduled office hours. In order to receive accommodations in this course, you must provide me with a Letter of Accommodation from the Disability Resource Center (DRC). The DRC coordinates campus disability services available to students with disabilities. Visit the DRC website, email the DRC, contact them by phone at (859) 257-2754, or visit their office on the corner of Rose Street and Huguelet Drive in the Multidisciplinary Science Building, Suite 407.

Non-Discrimination Statement and Title IX Information

UK is committed to providing a safe learning, living, and working environment for all members of the University community. The University maintains a comprehensive program which protects all members from discrimination, harassment, and sexual misconduct. For complete information about UK's prohibition on discrimination and harassment on aspects such as race, color, ethnic origin, national origin, creed, religion, political belief, sex, and sexual orientation, please see the electronic version of UK's Administrative Regulation 6:1 ("Policy on Discrimination and Harassment"). In accordance with Title IX of the Education Amendments of 1972, the University prohibits discrimination and harassment on the basis of sex in academics, employment, and all of its programs and activities. Sexual misconduct is a form of sexual harassment in which one act is severe enough to create a hostile environment based on sex and is prohibited between members of the University community and shall not be tolerated. For more details, please see the electronic version of Administrative Regulations 6:2 ("Policy and Procedures for Addressing and Resolving Allegations of Sexual Assault, Stalking, Dating Violence, Domestic Violence, and Sexual Exploitation"). Complaints regarding violations of University policies on discrimination, harassment, and sexual misconduct are handled by the Office of Institutional Equity and Equal Opportunity (IEEO), which is located in 13 Main Building and can be reached by phone at (859) 257-8927. You can also visit the IEEO's website.

Faculty members are obligated to forward any report made by a student related to IEEO matters to the Office of Institutional Equity and Equal Opportunity. Students can confidentially report alleged incidences through the Violence Intervention and Prevention Center, Counseling Center, or University Health Services.

Academic Integrity -- Prohibition on Plagiarism (Senate Rules 6.3.1)

Per University policy, students shall not plagiarize, cheat, or falsify or misuse academic records. Students are expected to adhere to University policy on cheating and plagiarism in all courses. The minimum penalty for a first offense is a zero on the assignment on which the offense occurred. If the offense is considered severe or the student has other academic offenses on their record, more serious penalties, up to suspension from the University may be imposed.

Plagiarism and cheating are serious breaches of academic conduct. Each student is advised to become familiar with the various forms of academic dishonesty as explained in the Code of Student Rights and Responsibilities. Complete information can be found on the Academic Ombud page. A plea of ignorance is not acceptable as a defense against the charge of academic dishonesty. It is important that you review this information as all ideas borrowed from others need to be properly credited.

Senate Rule 6.3.1 (see current Senate Rules) states that all academic work, written or otherwise, submitted by students to their instructors or other academic supervisors, is expected to be the result of their own thought, research, or self-expression. In cases where students feel unsure about a question of plagiarism involving their work, they are obliged to consult their instructors on the matter before submission.

When students submit work purporting to be their own, but which in any way borrows ideas, organization, wording, or content from another source without appropriate acknowledgment of the fact, the students are guilty of plagiarism.

Plagiarism includes reproducing someone else's work (including, but not limited to a published article, a book, a website, computer code, or a paper from a friend) without clear attribution. Plagiarism also includes the practice of employing or allowing another person to alter or revise the work which a student submits as his/her own, whoever that other person may be, except under specific circumstances (e.g. Writing Center review or peer review) allowed by the Instructor of Record or that person's designee. Plagiarism may also include double submission, self-plagiarism, or unauthorized resubmission of one's own work, as defined by the instructor.

Students may discuss assignments among themselves or with an instructor or tutor, except where prohibited by the Instructor of Record (e.g. individual take-home exams). However, the actual work must be done by the student, and the student alone, unless collaboration is allowed by the Instructor of Record (e.g. group projects).

When a student's assignment involves research in outside sources or information, the student must carefully acknowledge exactly what, where and how he/she has employed them. If the words of someone else are used, the student must put quotation marks around the passage in question and add an appropriate indication of its origin. Making simple changes while leaving the organization, content, and phraseology intact is plagiaristic. However, nothing in these Rules shall apply to those ideas, which are so generally and freely circulated as to be a part of the public domain.

Please note: Any assignment you turn in may be submitted to an electronic database to check for plagiarism.

Academic Integrity -- Prohibition on Cheating (Senate Rules 6.3.2)

Cheating is defined by its general usage. It includes, but is not limited to, the wrongfully giving, taking, or presenting any information or material by a student with the intent of aiding himself/herself or another on any academic work which is considered in any way in the determination of the final grade. The fact that a student could not have benefited from an action is not by itself proof that the action does not constitute cheating. Any question of definition shall be referred to the University Appeals Board.

Academic Integrity -- Prohibition on Falsification/Misuse of Academic Records (SR 6.3.3)

Maintaining the integrity, accuracy, and appropriate privacy of student academic records is an essential administrative function of the University and a basic protection of all students. Accordingly, the actual or attempted falsification, theft, misrepresentation or other alteration or misuse of any official academic record of the University, specifically including knowingly having unauthorized access to such records or the unauthorized disclosure of information contained in such records, is a serious academic offense. As used in this context, "academic record" includes all paper and electronic versions of the partial or complete permanent academic record, all official and unofficial academic transcripts, application documents and admission credentials, and all academic record transaction documents. The minimum sanction for falsification, including the omission of information, or attempted falsification or other misuse of academic records as described in this section is suspension for one semester.


Optimizing Compilers