What programming language compiler researchers should know about computer architecture
Download
1 / 30

What Programming Language/Compiler Researchers should Know about Computer Architecture - PowerPoint PPT Presentation


  • 100 Views
  • Uploaded on

What Programming Language/Compiler Researchers should Know about Computer Architecture. Lizy Kurian John Department of Electrical and Computer Engineering The University of Texas at Austin. Somebody once said.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' What Programming Language/Compiler Researchers should Know about Computer Architecture' - addison-skinner


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
What programming language compiler researchers should know about computer architecture

What Programming Language/Compiler Researchers should Know about Computer Architecture

Lizy Kurian John

Department of Electrical and Computer Engineering

The University of Texas at Austin

Lizy Kurian John, LCA, UT Austin


Somebody once said
Somebody once said about Computer Architecture

“Computers are dumb actors and compilers/programmers are the master playwrights.”

Lizy Kurian John, LCA, UT Austin


Computer architecture basics
Computer Architecture Basics about Computer Architecture

  • ISAs

  • RISC vs CISC

  • Assembly language coding

  • Datapath (ALU) and controller

  • Pipelining

  • Caches

  • Out of order execution

    Hennessy and Patterson architecture books

Lizy Kurian John, LCA, UT Austin


Basics
Basics about Computer Architecture

  • ILP

  • DLP

  • TLP

  • Massive parallelism

  • SIMD/MIMD

  • VLIW

  • Performance and Power metrics

Hennessy and Patterson architecture books

ASPLOS, ISCA, Micro, HPCA

Lizy Kurian John, LCA, UT Austin


The bottomline
The Bottomline about Computer Architecture

Programming Language choice affects performance and power

eg: Java

Compilers affect Performance and Power

Lizy Kurian John, LCA, UT Austin


A java hardware interpreter

Java class file about Computer Architecture

Native machine instructions

Hardware bytecode translator

Decode

Execute

Fetch

Native executable

bytecodes

A Java Hardware Interpreter

  • Radhakrishnan, Ph. D 2000 (ISCA2000, ICS2001)

  • This technique used by Nazomi Communications, Parthus (Chicory Systems)

Lizy Kurian John, LCA, UT Austin


Hardint performance
HardInt Performance about Computer Architecture

  • Hard-Int performs consistently better than the interpreter

  • In JIT mode, significant performance boost in 4 of 5 applications.

Lizy Kurian John, LCA, UT Austin


Compiler and power
Compiler and Power about Computer Architecture

A

A

E

A

Cycle 1

Cycle 1

B

C

E

B

C

B

C

Cycle 2

Cycle 2

E

D

D

D

Cycle 3

Cycle 3

F

F

F

Cycle 4

Cycle 4

DDG

Peak Power = 2

Energy = 6

Peak Power = 3

Energy = 6

Lizy Kurian John, LCA, UT Austin


Valluri et al 2001 hpca workshop
Valluri et al 2001 HPCA workshop about Computer Architecture

  • Quantitative Study

  • Influence of state-of-the-art optimizations on energy and power of the processor examined

  • Optimizations studied

    • Standard –O1 to –O4 of DEC Alpha’s cc compiler

    • Four individual optimizations – simple basic-block instruction scheduling, loop unrolling, function inlining, and aggressive global scheduling

Lizy Kurian John, LCA, UT Austin


Standard optimizations on power
Standard Optimizations on Power about Computer Architecture

Lizy Kurian John, LCA, UT Austin


Somebody once said1
Somebody once said about Computer Architecture

“Computers are dumb actors and compilers/programmers are the master playwrights.”

Lizy Kurian John, LCA, UT Austin


A large part of modern out of order processors
A large part of modern out of order processors about Computer Architecture

is hardware that could have been eliminated if a good compiler existed.

Lizy Kurian John, LCA, UT Austin


Let me get more arrogant
Let me get more arrogant about Computer Architecture

A large part of modern out of order processors was designed because

computer architects thought compiler writers could not do a good job.

Lizy Kurian John, LCA, UT Austin


Value prediction
Value Prediction about Computer Architecture

Is a slap on your face

Shen and Lipasti

Lizy Kurian John, LCA, UT Austin


Value locality
Value Locality about Computer Architecture

  • Likelihood that an instruction’s computed result or a similar predictable result will occur soon

  • Observation – a limited set of unique values constitute majority of values produced and consumed during execution

Lizy Kurian John, LCA, UT Austin


Load value locality
Load Value Locality about Computer Architecture

Lizy Kurian John, LCA, UT Austin


Causes of value locality
Causes of value locality about Computer Architecture

  • Data redundancy – many 0s, sparse matrices, white space in files, empty cells in spread sheets

  • Program constants –

  • Computed branches – base address for jump tables is a run-time constant

  • Virtual function calls – involve code to load a function pointer – can be constant

Lizy Kurian John, LCA, UT Austin


Causes of value locality1
Causes of value locality about Computer Architecture

  • Memory alias resolution – compiler conservatively generates code – may contain stores that alias with loads

  • Register spill code – stores and subsequent loads

  • Convergent algorithms – convergence in parts of algorithms before global convergence

  • Polling algorithms

Lizy Kurian John, LCA, UT Austin


2 extremist views
2 Extremist Views about Computer Architecture

Anything that can be done in hardware should be done in hardware.

Anything that can be done in software should be done in software.

Lizy Kurian John, LCA, UT Austin


What do we need
What do we need? about Computer Architecture

The Dumb actor

Or the

The defiant actor – who pays very little attention to the script

Lizy Kurian John, LCA, UT Austin


Challenging all compiler writers
Challenging all compiler writers about Computer Architecture

The last 15 years was the defiant actor’s era

What about the next 15? TLP, Multithreading, Parallelizing compilers – It’s time for a lot more dumb acting from the architect’s side.

And it’s time for some good scriptwriting from the compiler writer’s side.

Lizy Kurian John, LCA, UT Austin


Backup

BACKUP about Computer Architecture

Lizy Kurian John, LCA, UT Austin


Compiler optimzations
Compiler Optimzations about Computer Architecture

  • cc - Native C compiler on Dec Alpha 21064 running OSF1 operating system

  • gcc – Used to study the effect of individual optimizations

Lizy Kurian John, LCA, UT Austin


Std optimizations levels on cc
Std Optimizations Levels on about Computer Architecturecc

-O0 – No optimizations performed

-O1 – Local optimizations such as CSE, copy propagation, IVE etc

-O2 – Inline expansion of static procedures and global optimizations such as loop unrolling, instruction scheduling

-O3 – Inline expansion of global procedures

-O4 – s/w pipelining, loop vectorization etc

Lizy Kurian John, LCA, UT Austin


Std optimizations levels on g cc
Std Optimizations Levels on g about Computer Architecturecc

-O0 – No optimizations performed

-O1 – Local optimizations such as CSE, copy propagation, dead-code elimination etc

-O2 – aggressive instruction scheduling

-O3 – Inlining of procedures

  • Almost same optimizations in each level of cc and gcc

  • In cc and gcc, optimizations that increase ILP are in levels -O2, -O3, and -O4

  • cc used where ever possible, gcc used used where specific hooks are required

NOTE:

Lizy Kurian John, LCA, UT Austin


Individual optimizations
Individual Optimizations about Computer Architecture

  • Four gcc optimizations, all optimizations applied on top -O1

  • -fschedule-insns – local register allocation followed by basic-block list scheduling

  • -fschedule-insns2 – Postpass scheduling done

  • -finline-functions – Integrated all simple functions into their callers

  • -funroll-loops – Perform the optimization of loop unrolling

Lizy Kurian John, LCA, UT Austin


Some observations
Some observations about Computer Architecture

  • Energy consumption reduces when # of instructions is reduced, i.e., when the total work done is less, energy is less

  • Power dissipation is directly proportional to IPC

Lizy Kurian John, LCA, UT Austin


Observations contd
Observations (contd.) about Computer Architecture

  • Function inlining was found to be good for both power and energy

  • Unrolling was found to be good for energy consumption but bad for power dissipation

Lizy Kurian John, LCA, UT Austin


Mmx simd
MMX/SIMD about Computer Architecture

Automatic usage of SIMD ISA still difficult 10+ years after introduction of MMX.

Lizy Kurian John, LCA, UT Austin


Standard optimizations on power contd
Standard Optimizations on Power (Contd) about Computer Architecture

Lizy Kurian John, LCA, UT Austin


ad