Predication (computer architecture): Difference between revisions

Content deleted Content added
Line 54:
*Predication complicates the hardware by adding levels of [[control unit|logic]] to critical [[datapath|paths]] and potentially degrades clock speed.
*A predicated block includes cycles for all operations, so shorter [[Control flow graph|paths]] may take longer and be penalized.
*Predication is not speculated and causes a longer dependency chain. For orderedmost data this translates to a performance loss compared to a easily-predictable branch.<ref>{{cite web |last1=Cordes |first1=Peter |title=assembly - How does Out of Order execution work with conditional instructions, Ex: CMOVcc in Intel or ADDNE (Add not equal) in ARM |url=https://stackoverflow.com/a/50960323 |website=Stack Overflow |quote=Unlike with control dependencies (branches), they don't predict or speculate what the flags will be, so a cmovcc instead of a jcc can create a loop-carried dependency chain and end up being worse than a predictable branch. gcc optimization flag -O3 makes code slower than -O2 is an example of that. Linus Torvalds explains in more detail...}}</ref>
 
Predication is most effective when paths are balanced or when the longest path is the most frequently executed,<ref name="Fisher04"/> but determining such a path is very difficult at compile time, even in the presence of [[profiling (computer programming)|profiling information]].