19
Siddhesh Poyarekar

Siddhesh Poyarekar@siddhesh_p [email protected] Get this slide deck at:

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

Siddhesh Poyarekar

Page 2: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

●●●●

Page 3: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

●●

Page 4: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

CONTROL UNIT

RAM

CPU

FLOATING POINT UNIT

INTEGER UNIT

INPUT OUTPUT

int main (void){ return 0}

/tmp/foo.c: In function ‘main’:/tmp/foo.c:4:1: error: expected ‘;’ before ‘}’ token } ^

Page 5: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

CONTROL UNIT

RAM

EXECUTE

FLOATING POINT UNIT

INTEGER UNIT

FETCH

DECODE COMMIT

CPU

REGISTERSrax,rbx, rcx, rdx, r8, r9...

Page 6: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

Image by Hiroshige Goto

Page 7: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

●○

●○○○○○○

Come for my discussion on Hardware

Vulnerabilities!

Page 8: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

●○

●●●

■■■

Page 9: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

●○

●○○

●○

●○○

●●

Page 10: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

Read Program Code

Optimize Program Logic

Generate Machine Code

Page 11: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

Intermediate Representation!

Read Program Code

Optimize Program Logic

Generate Machine Code

The front end:A dozen or so programming languages!

The middle end:A few

HUNDRED optimization

passes!

The back end:Translate code

into the machine instructions.

Page 12: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

Read Program Code

Optimize Program Logic

Generate Machine Code

gcc/c-family/*gc/cp/*

gcc/fortran/*...

gcc/passes.defgcc/tree-*

...

gcc/config/<arch>/*

GIMPLERTL

Page 13: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

Read Program Code

Optimize Program Logic

Generate Machine Code

Clang. It’s a separate project!

lib/*

lib/Target/*

LLVM IR

Page 14: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

Read Program Code

Optimize Program Logic

Generate Machine Code

The front end:A dozen or so programming languages!

The middle end:A few

HUNDRED optimization

passes!

The back end:Translate code

into the machine instructions.Tweak Translation of code to suit

the microarchitecture

Intermediate Representation

Tweak Optimization pass Behaviour to suit the

microarchitecture.

Page 15: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

Read Program Code

Optimize Program Logic

Generate Machine Code

The front end:A dozen or so programming languages!

The middle end:A few

HUNDRED optimization

passes!

The back end:Translate code

into the machine instructions.

gcc/config/<arch>/*.md

GIMPLERTL

gcc/config/<arch>/*.c

Page 16: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

Read Program Code

Optimize Program Logic

Generate Machine Code

The front end:A dozen or so programming languages!

The middle end:A few

HUNDRED optimization

passes!

The back end:Translate code

into the machine instructions.

gcc/config/<arch>/*.td

GIMPLERTL

lib/Target/<arch>/*.cpp

Page 17: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

●○○

●○

●○

●○

Page 18: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

●●●

○○

●○○

Page 19: Siddhesh Poyarekar@siddhesh_p siddhesh@gotplt.org Get this slide deck at:

[email protected]@siddhesh_p

Get this slide deck at: https://siddhesh.in/mcpu.pdf