Dino's Blog

Knowledge is the cheapest and most rewarding investment

AST & Symbol Tables

CSC488 Lec4

Internal Compiler Data Structures Parse Tree: The output of the syntax analysis. It represents the syntax structure of the program. Abstract Syntax Tree: A modified parse tree. In most compilers...

Syntax Analysis

CSC488 Lec2 & 3

Syntax Analysis Syntax Analysis: Parse the tokens into a parse tree Input: A token stream Output: A parse tree of the program The syntax of a language defines the sequences of language token...

Dataflow Analysis 2 & Loop

CSCD70 Lec3

Framework   Reaching Definitions Live Variables Available Expression Domain Sets of definitions Sets of variables Sets of express...

Available Expression

CSCD70 Tut3

Available Expressions Why do we want to study Available Expression Global Common Subexpressions 1 2 3 4 5 6 7 if (...) { x = m + n; } else{ y = m + n; } z = m + n; // m + n has alredy b...

Lexical Analysis

CSC488 Lec1

Lexical Analysis Lexical Analysis: Chop the program into tokens Input: A character stream Output: A token stream Lexical analysis transforms its input (a stream of characters) from one / mor...

Introduction to LLVM 2

CSCD70 tut2

LLVM Transform Pass User-Use-Value relation Suppose that we have the following code to optimize: 1 2 3 4 5 6 %2 = add %1, 0 ; Algebraic Identity %3 = mul %2, 2 -- Suppose we omit the identity ...

Dataflow Analysis

CSCD70 Lec2

What is Data Flow Analysis Local analysis (e.g., value numbering) analyze effect of each instruction compose effects of instructions to derive information from beginning of basi...

Introduction to LLVM

CSCD70 tut1

C++ Review Pass by Reference 1 void foo(int &a); What is there an & before variable a? Pass by Reference Review: What is the purpose of “Pass by Pointer”? Modify t...

Compiler Optimization - Introduction

CSCD70 Week1

Purpose of compilers Translate one language into another e.g., convert C++ into x86 object code Improve (i.e. “optimize”) the code e.g., make the code run 3 times...

Chapter2

Macro

Review OOP In the traditional OOP, an object is a data structure that stores values called the (instance) attribute of the object, that is also associated with functions called (instance) methods t...