CSCE 3612 ch5-2

CSCE 3612 ch5-2 - Program design and analysis Compilation...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Program design and analysis Compilation flow. Basic statement translation. Basic optimizations. Interpreters and just-in-time compilers.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Compilation Compilation strategy (Wirth): compilation = translation + optimization Compiler determines quality of code: use of CPU resources; memory access scheduling; code size.
Background image of page 2
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Basic compilation phases HLL parsing, symbol table machine-independent optimizations machine-dependent optimizations assembly
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Statement translation and optimization Source code is translated into  intermediate form such as CDFG. CDFG is transformed/optimized. CDFG is translated into instructions with  optimization decisions. Instructions are further optimized.
Background image of page 4
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Arithmetic expressions a*b + 5*(c-d) expression DFG * - * + a b c d 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. 2 3 4 1 Arithmetic expressions, cont’d. ADR r4,a MOV r1,[r4] ADR r4,b MOV r2,[r4] ADD r3,r1,r2 DFG * - * + a b c d 5 ADR r4,c MOV r1,[r4] ADR r4,d MOV r5,[r4] SUB r6,r4,r5 MUL r7,r6,#5 ADD r8,r7,r3 code
Background image of page 6
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Control code generation if (a+b > 0) x = 5; else x = 7; a+b>0 x=5 x=7
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. 3 2 1 Control code generation, cont’d. ADR r5,a LDR r1,[r5] ADR r5,b LDR r2,b ADD r3,r1,r2 BLE label3 a+b>0 x=5 x=7 LDR r3,#5 ADR r5,x STR r3,[r5] B stmtent LDR r3,#7 ADR r5,x STR r3,[r5] stmtent . ..
Background image of page 8
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Procedure linkage
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/30/2008 for the course CSCE 3612 taught by Professor Goodrum during the Fall '08 term at North Texas.

Page1 / 32

CSCE 3612 ch5-2 - Program design and analysis Compilation...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online