Research Article

IP-Enabled C/C++ Based High Level Synthesis: A Step towards Better Designer Productivity and Design Performance

Algorithm 5

Identification of matrix operations in LLVM IR.
Input: CDFG of Application in C/C++
Output: CDFG with cluster of operations (sub-graph) identified as matrix operations
(1)  For each Basic Block
(2)  Perform Dominator Analysis to identify nested loops
(3)    For each set of nested loops
(4)   Label loops using “Lx” as defined in Section 3.2.1.
(5)   Select nodes in CDFG bound by loop with highest x value
(6)   Perform subgraph-matching for subgraphs shown in Figures 2, 3, 4, and 5
(7)    If  true  for Figure 2
(8)    Mark nested loop set as matrix-matrix multiplication
(9)    If  true  for Figure 3
(10)  Mark nested loop set as matrix-vector multiplication
(11)    If  true  for Figure 4
(12)  Mark nested loop set as matrix scaling
(13)    If  true  for Figure 5
(14)  Mark nested loop set as matrix add/subtract
(15)   EndFor
(16)  EndFor