Evaluation of branch-prediction methods on traces from commercial applications R.B. Hilgendorf, G. J. Helm, W. Rosenstiel.

Slides:



Advertisements
Similar presentations
Branch prediction Titov Alexander MDSP November, 2009.
Advertisements

Pipelining V Topics Branch prediction State machine design Systems I.
Lecture 8 Dynamic Branch Prediction, Superscalar and VLIW Advanced Computer Architecture COE 501.
Dynamic Branch Prediction (Sec 4.3) Control dependences become a limiting factor in exploiting ILP So far, we’ve discussed only static branch prediction.
Computer Organization and Architecture (AT70.01) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Dr. Sumanta Guha Slide Sources: Based.
CPE 631: Branch Prediction Electrical and Computer Engineering University of Alabama in Huntsville Aleksandar Milenkovic,
Dynamic Branch Prediction
Pipeline Hazards Pipeline hazards These are situations that inhibit that the next instruction can be processed in the next stage of the pipeline. This.
Computer Organization and Architecture
Chapter 8. Pipelining. Instruction Hazards Overview Whenever the stream of instructions supplied by the instruction fetch unit is interrupted, the pipeline.
Chapter 12 CPU Structure and Function. CPU Sequence Fetch instructions Interpret instructions Fetch data Process data Write data.
Computer Organization and Architecture
Computer Organization and Architecture
W04S1 COMP s1 Seminar 4: Branch Prediction Slides due to David A. Patterson, 2001.
CS 7810 Lecture 7 Trace Cache: A Low Latency Approach to High Bandwidth Instruction Fetching E. Rotenberg, S. Bennett, J.E. Smith Proceedings of MICRO-29.
Computer Organization and Architecture The CPU Structure.
Chapter 12 Pipelining Strategies Performance Hazards.
EECC551 - Shaaban #1 lec # 5 Fall Reduction of Control Hazards (Branch) Stalls with Dynamic Branch Prediction So far we have dealt with.
EENG449b/Savvides Lec /17/04 February 17, 2004 Prof. Andreas Savvides Spring EENG 449bG/CPSC 439bG.
Pipelining Fetch instruction Decode instruction Calculate operands (i.e. EAs) Fetch operands Execute instructions Write result Overlap these operations.
Branch Target Buffers BPB: Tag + Prediction
Chapter 12 CPU Structure and Function. Example Register Organizations.
Computer Architecture Instruction Level Parallelism Dr. Esam Al-Qaralleh.
Dynamic Branch Prediction
EENG449b/Savvides Lec /25/05 March 24, 2005 Prof. Andreas Savvides Spring g449b EENG 449bG/CPSC 439bG.
CIS 429/529 Winter 2007 Branch Prediction.1 Branch Prediction, Multiple Issue.
Pipelining. Overview Pipelining is widely used in modern processors. Pipelining improves system performance in terms of throughput. Pipelined organization.
Evaluation of Dynamic Branch Prediction Schemes in a MIPS Pipeline Debajit Bhattacharya Ali JavadiAbhari ELE 475 Final Project 9 th May, 2012.
Part II: Addressing Modes
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
CH12 CPU Structure and Function
5-Stage Pipelining Fetch Instruction (FI) Fetch Operand (FO) Decode Instruction (DI) Write Operand (WO) Execution Instruction (EI) S3S3 S4S4 S1S1 S2S2.
Ch2. Instruction-Level Parallelism & Its Exploitation 2. Dynamic Scheduling ECE562/468 Advanced Computer Architecture Prof. Honggang Wang ECE Department.
Presented by: Sergio Ospina Qing Gao. Contents ♦ 12.1 Processor Organization ♦ 12.2 Register Organization ♦ 12.3 Instruction Cycle ♦ 12.4 Instruction.
Page 1 Trace Caches Michele Co CS 451. Page 2 Motivation  High performance superscalar processors  High instruction throughput  Exploit ILP –Wider.
CS 211: Computer Architecture Lecture 6 Module 2 Exploiting Instruction Level Parallelism with Software Approaches Instructor: Morris Lancaster.
1 Dynamic Branch Prediction. 2 Why do we want to predict branches? MIPS based pipeline – 1 instruction issued per cycle, branch hazard of 1 cycle. –Delayed.
CSCI 6461: Computer Architecture Branch Prediction Instructor: M. Lancaster Corresponding to Hennessey and Patterson Fifth Edition Section 3.3 and Part.
D75P 34 – HNC Computer Architecture
Branch.1 10/14 Branch Prediction Static, Dynamic Branch prediction techniques.
Computer System Design
Superscalar - summary Superscalar machines have multiple functional units (FUs) eg 2 x integer ALU, 1 x FPU, 1 x branch, 1 x load/store Requires complex.
CSC 4250 Computer Architectures October 31, 2006 Chapter 3.Instruction-Level Parallelism & Its Dynamic Exploitation.
Branch Prediction Prof. Mikko H. Lipasti University of Wisconsin-Madison Lecture notes based on notes by John P. Shen Updated by Mikko Lipasti.
CPE 631 Session 17 Branch Prediction Electrical and Computer Engineering University of Alabama in Huntsville.
CS 6290 Branch Prediction. Control Dependencies Branches are very frequent –Approx. 20% of all instructions Can not wait until we know where it goes –Long.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 13: Branch prediction (Chapter 4/6)
COMPSYS 304 Computer Architecture Speculation & Branching Morning visitors - Paradise Bay, Bay of Islands.
Computer Architecture Chapter (14): Processor Structure and Function
Prof. Hsien-Hsin Sean Lee
CS203 – Advanced Computer Architecture
Dynamic Branch Prediction
Computer Architecture Advanced Branch Prediction
CS5100 Advanced Computer Architecture Advanced Branch Prediction
CMSC 611: Advanced Computer Architecture
Module 3: Branch Prediction
CPE 631: Branch Prediction
Branch statistics Branches occur every 4-6 instructions (16-25%) in integer programs; somewhat less frequently in scientific ones Unconditional branches.
Lecture 10: Branch Prediction and Instruction Delivery
Sequencing, Selection, and Loops in Machine Language
Computer Architecture
Dynamic Hardware Prediction
Chapter 11 Processor Structure and function
Spring 2019 Prof. Eric Rotenberg
Presentation transcript:

Evaluation of branch-prediction methods on traces from commercial applications R.B. Hilgendorf, G. J. Helm, W. Rosenstiel

Progress? Significant, but it is still not clear which, if any, of the currently advocated methods is superior. SPECmark test suite traces are often used –The gcc trace seems to be the most difficult for branch-prediction

Effect of Multitasking OS Increases the activity in a processor For the IBM ESA/390 series there exists a completely different set of traces that show the involvement of the OS

Trace Description T1: Transaction processing such as database queries in warehouse management T2: Interactive usage in program development. Searching, compiling. T3: Transaction processing from tasks such as hotel reservations. T4: Commercial batch jobs.

Distinction Static branches. Found in the binary program. Eliminate duplicates. Dynamic branches. Occur when running a program. Found in the trace. The term dynamic instructions means the total number of instructions in the trace.

The ESA/390 Instruction Set About 17 different branch instructions The majority of these in the traces receive their target address –From a general purpose register –A base register plus an index register plus a constant Coding the index register as zero will force even unconditional branches never to branch When using a certain mask all branches will take

Continued Using only the opcode of a branch will not provide enough information A further obstacle is that there is no distinct call and no return instruction

Branch Target Buffer Is intended to contain the target address for each branch and prediction information Normally addressed using the instruction address of the branch instruction Various techniques fold the complete address space into a usable BTB of affordable size

Continued If a branch is not in the BTB, that counts as a miss –First or cold misses plus misses due to replacement For small BTBs replacement misses dominate

Continued Large BTB –BTB stores effective addresses, not absolute addresses. –After a task switch part of the BTB content is useless, or worse, conterproductive –Instructions that are not even branches may be predicted

Continued Modern processors generally fetch more than a single instruction per cycle –An address range must be tested for a branch – put block addresses in the table Not preferable

Local History Pattern% TakenPrediction NNN7.8NT NNT34.1NT NTN51.9T NTT67.9T TNN32.6NT TNT64.4T TTN79.1T TTT97.7T

Global History One large history register Addresses a table of two-bit saturation counters –Incremented when a branch is taken, decremented when a branch is not taken, but 3++ = 3 and 0-- = 0 –Best! A path is used to predict!

Moving Targets We have assumed so far that –The target address in the BTB was correct –We only have to worry about taken/not taken Some branches may have different target addresses –Return –Indirect branches Case statement, jump tables, computed go-tos

Moving Targets (contd) If you have specific call and return instructions, you can use a return stack to get 100% prediction on returns. The ESA/390 does not have such instructions (neither does SPARC) A branch can be used as a call or a return

Continued An identification stack into which each possible call is written with its target and return address A return cache that receives new entries from the IS when the stored RA matches the target address of a possible return.