summaryrefslogtreecommitdiffstats
path: root/content/zettel/1c8.md
blob: 9997554b0812478e14508cc05ca17d13bf8f47a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
+++
title = "If-conversion"
author = "Yann Herklotz"
tags = []
categories = []
backlinks = ["2b1e", "1c7", "1c2h", "1c", "1b8"]
forwardlinks = ["1b6", "1b8", "1c9"]
zettelid = "1c8"
+++

If-conversion is an optimisation which is very common in HLS tools. It
transforms basic blocks ([\#1b6]) that do not contain any loops, into
single hyperblocks ([\#1b8]), which use predicated instructions instead.
However, to support such an optimisation in a verified high-level
synthesis tool, the verification algorithm needs to support SAT checking
of the predicates. It is the conversion that introduces predicated
instructions which can make use of the hyperblocks. It converts
conditional statements into predicated instructions. This transformation
has a few limitations on the kind of conditional statements that it can
translate. First, only conditional statements without loops can be
translated, therefore, one must identify cycles in the control-flow
before performing the if-conversion. Secondly, if-conversion will not
always result in more efficient code, so it should not be applied to any
conditional statements. Instead, it is best applied to conditional
statements where each branch will take a similar amount of time to
execute.

  [\#1b6]: /zettel/1b6
  [\#1b8]: /zettel/1b8