103
Beatriz Aguilar Gallo SPECULATION AND PREDICATION

Speculation and Predication in Compilers

Embed Size (px)

Citation preview

Beatriz Aguilar Gallo

SPECULATION AND

PREDICATION

1.  Introduction

2.  Introduction to Predication

3.  Introduction to Speculation

4.  Intel Itanium (IA-64), EPIC Architecture

5.  Conclusions

OUTLINE

!  ILP measured the number of instructions that can be performed during a single clock cycle

1. INTRODUCTION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  ILP measured the number of instructions that can be performed during a single clock cycle

!  Limited by: - Dependences - Branches

1. INTRODUCTION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  ILP measured the number of instructions that can be performed during a single clock cycle

!  Limited by: - Dependences - Branches

!  Two techniques to exploit ILP !  Predication !  Speculation

1. INTRODUCTION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  ILP measured the number of instructions that can be performed during a single clock cycle

!  Limited by: - Dependences - Branches

!  Two techniques to exploit ILP !  Predication !  Speculation

!  EPIC (Explicitly Parallel Instruction Computing) !  Intel Itanium processor

1. INTRODUCTION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Control dependences limit the amount of parallelism that can be exploited

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Control dependences limit the amount of parallelism that can be exploited

!  Predication " An instruction refers to a condition, which is evaluated as part of the instruction execution.

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Control dependences limit the amount of parallelism that can be exploited

!  Predication " An instruction refers to a condition, which is evaluated as part of the instruction execution.

!  If the condition is true, the instruction is executed normally

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Control dependences limit the amount of parallelism that can be exploited

!  Predication " An instruction refers to a condition, which is evaluated as part of the instruction execution.

!  If the condition is true, the instruction is executed normally

!  if the condition is false, the execution continues as if the instruction were a no-op

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Control dependences limit the amount of parallelism that can be exploited

!  Predication " An instruction refers to a condition, which is evaluated as part of the instruction execution.

!  If the condition is true, the instruction is executed normally

!  if the condition is false, the execution continues as if the instruction were a no-op

!  Effects of predication

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Control dependences limit the amount of parallelism that can be exploited

!  Predication " An instruction refers to a condition, which is evaluated as part of the instruction execution.

!  If the condition is true, the instruction is executed normally

!  if the condition is false, the execution continues as if the instruction were a no-op

!  Effects of predication !  Eliminate branches " execute both path of the flow

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Control dependences limit the amount of parallelism that can be exploited

!  Predication " An instruction refers to a condition, which is evaluated as part of the instruction execution.

!  If the condition is true, the instruction is executed normally

!  if the condition is false, the execution continues as if the instruction were a no-op

!  Effects of predication !  Eliminate branches " execute both path of the flow !  Converts control dependences into data dependences " If-conversion

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Control dependences limit the amount of parallelism that can be exploited

!  Predication " An instruction refers to a condition, which is evaluated as part of the instruction execution.

!  If the condition is true, the instruction is executed normally

!  if the condition is false, the execution continues as if the instruction were a no-op

!  Effects of predication !  Eliminate branches " execute both path of the flow !  Converts control dependences into data dependences " If-conversion

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  If-conversion " Transforms conditional branches into

! Operations that defines predicates

! Operations guarded by predicates, corresponding to alternative control paths

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Control dependences limit the amount of parallelism that can be exploited

!  Predication " An instruction refers to a condition, which is evaluated as part of the instruction execution.

!  If the condition is true, the instruction is executed normally

!  if the condition is false, the execution continues as if the instruction was a no-op

!  Effects of predication

!  Eliminate branches " execute both path of the flow

!  Converts control dependences into data dependences " If-conversion

!  Necessary include predicated instructions to the ISA

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Predication example

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Predication complications

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Predication complications

!  Increase the fetch utilization

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Predication complications

!  Increase the fetch utilization

! When Annul an operation?

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Predication complications

!  Increase the fetch utilization

! When Annul an operation?

!  Early in the pipeline during instruction issue " the value of controlling condition must be known early

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Predication complications

!  Increase the fetch utilization

! When Annul an operation?

!  Early in the pipeline during instruction issue " the value of controlling condition must be known early

!  Later in the pipeline before commit any result or raise an exception " annulled instruction will consume FU and will have negative impact in performance

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

Predication is useful for

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

Predication in useful for ! Implementing short alternative control flows

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

Predication is useful for ! Implementing short alternative control flows ! Eliminating some unpredictable branches

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

Predication is useful for ! Implementing short alternative control flows ! Eliminating some unpredictable branches ! Reducing the overhead of global code scheduling

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

Predication is useful for ! Implementing short alternative control flows ! Eliminating some unpredictable branches ! Reducing the overhead of global code scheduling

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

Predication usefulness limited by

Predication is useful for ! Implementing short alternative control flows ! Eliminating some unpredictable branches ! Reducing the overhead of global code scheduling

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

Predication usefulness limited by ! Predicated instructions annulled take processor

resources

Predication is useful for ! Implementing short alternative control flows ! Eliminating some unpredictable branches ! Reducing the overhead of global code scheduling

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

Predication usefulness limited by ! Predicated instructions annulled take processor resources

! Most useful when the predicate can be evaluated early

Predication is useful for ! Implementing short alternative control flows ! Eliminating some unpredictable branches ! Reducing the overhead of global code scheduling

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

Predication usefulness limited by ! Predicated instructions annulled take processor resources

! Most useful when the predicate can be evaluated early

! Conditional instructions can be limited with complex alternative sequences

Predication is useful for ! Implementing short alternative control flows ! Eliminating some unpredictable branches ! Reducing the overhead of global code scheduling

2. INTRODUCTION TO PREDICATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

Predication usefulness limited by ! Predicated instructions annulled take processor resources

! Most useful when the predicate can be evaluated early

! Conditional instructions can be limited with complex alternative sequences

! Speed penalty compared with unconditional instructions

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Idea of speculation " refers to the early execution of memory operations in order to hide their latency

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Idea of speculation " refers to the early execution of memory operations in order to hide their latency

!  Two techniques to apply

! Hardware Speculation ! Software Speculation

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Idea of speculation " refers to the early execution of memory operations in order to hide their latency

!  Two techniques to apply

! Hardware Speculation ! Software Speculation

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two techniques to apply

! Hardware Speculation " hardware tables

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two techniques to apply

! Hardware Speculation " hardware tables ! Advantages 1.) It is responsive to changes in program behavior

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two techniques to apply

! Hardware Speculation " hardware tables

! Advantages 1.) It is responsive to changes in program behavior 2.) Can apply the optimization to selective instances

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two techniques to apply

! Hardware Speculation " hardware tables ! Advantages 1.) It is responsive to changes in program behavior

2.) Can apply the optimization to selective instances

! Disadvantage " requires that the optimization can be applied as the instructions travel down the pipeline

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Idea of speculation " refers to the early execution of memory operations in order to hide their latency

!  Two techniques to apply

! Hardware Speculation ! Software Speculation

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two techniques to apply

! Software Speculation " directly into instructions

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two techniques to apply

! Software Speculation " directly into instructions

! Advantages 1.) The program can be transformed assuming the speculations are correct

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two techniques to apply

! Software Speculation " directly into instructions ! Advantages 1.) The program can be transformed assuming the speculations are correct

2.) The optimizations need not be applied on each dynamic instance as it travels down the pipeline

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two techniques to apply

! Software Speculation " directly into instructions ! Advantages 1.) The program can be transformed assuming the speculations are correct

2.) The optimizations need not be applied on each dynamic instance as it travels down the pipeline

! Disadvantage 1.) Latency associated

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two techniques to apply

! Software Speculation " directly into instructions ! Advantages 1.) The program can be transformed assuming the speculations are correct

2.) The optimizations need not be applied on each dynamic instance as it travels down the pipeline

! Disadvantage 1.) Latency associated 2.) Necessary a recompilation

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two types of speculation

! Control Speculation

! Data Speculation

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two types of speculation

! Control Speculation

! Data Speculation

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two types of speculation

! Control Speculation

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two types of speculation

! Control Speculation

! Break control dependences

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two types of speculation

! Control Speculation

! Break control dependences

! How to break a control dependence?

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two types of speculation

! Control Speculation

! Break control dependences

! How to break a control dependence? Making an operation’s execution independent of the branch

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two types of speculation

! Control Speculation

! Break control dependences

! How to break a control dependence? Making an operation’s execution independent of the branch

! Problem "

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two types of speculation

! Control Speculation

! Break control dependences

! How to break a control dependence? Making an operation’s execution independent of the branch

! Problem " correct handling of exceptions

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Control Speculation Example:

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two types of speculation

! Control Speculation

! Data Speculation

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two types of speculation

! Data Speculation

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two types of speculation

! Data Speculation

! Breaks data flow dependences between memory operations

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two types of speculation

! Data Speculation

! Breaks data flow dependences between memory operations

! How to break a data dependence?

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Two types of speculation

! Data Speculation

! Breaks data flow dependences between memory operations

! How to break a data dependence? Guessing that the two memory operations will access different locations.

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Data Speculation Example:

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! Control + Data Speculation Example:

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! How to deal with exceptions ?

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! How to deal with exceptions ?

!  Ignore exceptions for speculative instructions. “Fast mode” in several processors.

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! How to deal with exceptions ?

!  Ignore exceptions for speculative instructions. “Fast mode” in several processors.

!  Checks are introduced to determine when an exception should occur.

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! How to deal with exceptions ?

!  Ignore exceptions for speculative instructions. “Fast mode” in several processors.

!  Checks are introduced to determine when an exception should occur.

!  Poison bits " attached to the result registers written by speculated instructions when the instructions cause exceptions.

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! How to deal with exceptions ?

!  Ignore exceptions for speculative instructions. “Fast mode” in several processors.

!  Checks are introduced to determine when an exception should occur.

!  Poison bits " attached to the result registers written by speculated instructions when the instructions cause exceptions.

!  Hardware buffers the instruction result until it is certain that the instruction is no longer speculative.

3. INTRODUCTION TO SPECULATION INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Explictily Parallel Instruction Computing" indicated parallelism of programs explicitly in the instruction sequence

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Explictily Parallel Instruction Computing" indicated parallelism of programs explicitly in the instruction sequence

!  Designed for high performance scientific and enterprise computing

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Explictily Parallel Instruction Computing" indicated parallelism of programs explicitly in the instruction sequence

!  Designed for high performance scientific and enterprise computing

!  Itanium support predication and speculation

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Explictily Parallel Instruction Computing" indicated parallelism of programs explicitly in the instruction sequence

!  Designed for high performance scientific and enterprise computing

!  Itanium support predication and speculation " is able to:

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Explictily Parallel Instruction Computing" indicated parallelism of programs explicitly in the instruction sequence

!  Designed for high performance scientific and enterprise computing

!  Itanium support predication and speculation " is able to:

!  Increase throughput

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Explictily Parallel Instruction Computing" indicated parallelism of programs explicitly in the instruction sequence

!  Designed for high performance scientific and enterprise computing

!  Itanium support predication and speculation " is able to:

!  Increase throughput

!  Reduce the need for explicit transfers and associated pipeline stalls

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Explictily Parallel Instruction Computing" indicated parallelism of programs explicitly in the instruction sequence

!  Designed for high performance scientific and enterprise computing

!  Itanium support predication and speculation " is able to:

!  Increase throughput

!  Reduce the need for explicit transfers and associated pipeline stalls PREDICATION

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Explictily Parallel Instruction Computing" indicated parallelism of programs explicitly in the instruction sequence

!  Designed for high performance scientific and enterprise computing

!  Itanium support predication and speculation " is able to:

!  Increase throughput

!  Reduce the need for explicit transfers and associated pipeline stalls PREDICATION

!  Reduce the latency associated with loads from memory,

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Explictily Parallel Instruction Computing" indicated parallelism of programs explicitly in the instruction sequence

!  Designed for high performance scientific and enterprise computing

!  Itanium support predication and speculation " is able to:

!  Increase throughput

!  Reduce the need for explicit transfers and associated pipeline stalls PREDICATION

!  Reduce the latency associated with loads from memory SPECULATION

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Predication in IA-64

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Predication in IA-64 !  Every instruction in the IA-64 architecture can be predicated

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Predication in IA-64 !  Every instruction in the IA-64 architecture can be predicated !  An instruction is predicated by specifying a predicate register

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Predication in IA-64 !  Every instruction in the IA-64 architecture can be predicated !  An instruction is predicated by specifying a predicate register !  Lower overhead in if-conversion

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Predication in IA-64 !  Every instruction in the IA-64 architecture can be predicated !  An instruction is predicated by specifying a predicate register !  Lower overhead in if-conversion

!  Speculation in IA-64

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Predication in IA-64 !  Every instruction in the IA-64 architecture can be predicated !  An instruction is predicated by specifying a predicate register !  Lower overhead in if-conversion

!  Speculation in IA-64 !  Separate support for control speculation " deferring with exceptions

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! It is possible use predication + speculation in IA-64?

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! It is possible use predication + speculation in IA-64?

YES, IMPACT project

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

! It is possible use predication + speculation in IA-64?

YES, IMPACT project

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Performance: Predication, Control Speculation, Data Speculation, Predication + Speculation

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Itanium Nowadays

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Itanium Nowadays !  Intel Itanium 9560 serie, Poulson (2012)

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Itanium Nowadays !  Intel Itanium 9560 serie, Poulson (2012) !  Next " Kittson 32 nm instead of 22 nm

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Itanium Nowadays !  Intel Itanium 9560 serie, Poulson (2012) !  Next " Kittson 32 nm instead of 22 nm

! Will it be the last Itanium?

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Itanium Nowadays !  Intel Itanium 9560 serie, Poulson (2012) !  Next " Kittson 32 nm instead of 22 nm

! Will it be the last Itanium? ! Maybe…

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Itanium Nowadays !  Intel Itanium 9560 serie, Poulson (2012) !  Next " Kittson 32 nm instead of 22 nm

! Will it be the last Itanium? ! Maybe…

! Why?

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Itanium Nowadays !  Intel Itanium 9560 serie, Poulson (2012) !  Next " Kittson 32 nm instead of 22 nm

! Will it be the last Itanium? ! Maybe…

! Why? !  High performance chip 15-core Xeon E7 v2 chip

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Itanium Nowadays !  Intel Itanium 9560 serie, Poulson (2012) !  Next " Kittson 32 nm instead of 22 nm

! Will it be the last Itanium? ! Maybe…

! Why? !  High performance chip 15-core Xeon E7 v2 chip

!  No compatibility problems

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Itanium Nowadays !  Intel Itanium 9560 serie, Poulson (2012) !  Next " Kittson 32 nm instead of 22 nm

! Will it be the last Itanium? ! Maybe…

! Why? !  High performance chip 15-core Xeon E7 v2 chip

!  No compatibility problems

!  Out of order processors

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Itanium Nowadays !  Intel Itanium 9560 serie, Poulson (2012) !  Next " Kittson 32 nm instead of 22 nm

! Will it be the last Itanium? ! Maybe…

! Why? !  High performance chip 15-core Xeon E7 v2 chip

!  No compatibility problems

!  Out of order processors !  Advantages:

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Itanium Nowadays !  Intel Itanium 9560 serie, Poulson (2012) !  Next " Kittson 32 nm instead of 22 nm

! Will it be the last Itanium? ! Maybe…

! Why? !  High performance chip 15-core Xeon E7 v2 chip

!  No compatibility problems

!  Out of order processors !  Advantages:

!  Instructions from different basic blocks to execute at the same time

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Itanium Nowadays !  Intel Itanium 9560 serie, Poulson (2012) !  Next " Kittson 32 nm instead of 22 nm

! Will it be the last Itanium? ! Maybe…

! Why? !  High performance chip 15-core Xeon E7 v2 chip

!  No compatibility problems

!  Out of order processors !  Advantages:

!  Instructions from different basic blocks to execute at the same time !  Dynamic scheduled

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Itanium Nowadays !  Intel Itanium 9560 serie, Poulson (2012) !  Next " Kittson 32 nm instead of 22 nm

! Will it be the last Itanium? ! Maybe…

! Why? !  High performance chip 15-core Xeon E7 v2 chip

!  No compatibility problems !  Out of order processors

!  Advantages: !  Instructions from different basic blocks to execute at the same time !  Dynamic scheduled !  No changes in the ISA

4. INTEL ITANIUM (IA 64), EPIC ARCHITECTURE INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Predication and speculation good techniques to ILP

5. CONCLUSIONS INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Predication and speculation good techniques to ILP

!  Itanium was good to include these features in the past but nowadays the appearance of new processors that support out of order execution and are more compatibles with the applications is causing that the used of Itanium decrease.

5. CONCLUSIONS INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

!  Predication and speculation good techniques to ILP

!  Itanium was good to include these features in the past but nowadays the appearance of new processors that support out of order execution and are more compatibles with the applications is causing that the used of Itanium decrease.

!  Not always it is possible predict how the market will evolve

5. CONCLUSIONS INTRODUCTION | INTRODUCTION TO PREDICATION | INTRODUCTION TO SPECULATION | INTEL ITANIUM (IA-64), EPIC ARCHITECTURE | CONCLUSIONS

Beatriz Aguilar Gallo

SPECULATION AND

PREDICATION