13.07.2015 Views

automatically exploiting cross-invocation parallelism using runtime ...

automatically exploiting cross-invocation parallelism using runtime ...

automatically exploiting cross-invocation parallelism using runtime ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Outer_Preheaderbr BB1ABB1A:ind1 = PHI [0, Outer_Preheader],[ind1.next, BB2]B:ind1.next = ind1 + 1c:p1 = ind1 >= ND:br p1, Sync_BlockBDCInner_PreheaderE:r1 = A[ind1]F:r2 = B[ind1]br BB2EFA B C DBB2G:ind2 = PHI [r1, Inner_Preheader],[ind2.next, BB3]H:ind2.next = ind2 + 1;I:p2 = ind2 > r2J:br p2, BB1HGIE FG H I JBB3K:r3 = getElementPtr(C[ind2])L:call update(r3)br BB2JKSync_Block(a) Pseudo IR codeKLLOuter_Preheaderbr BB1BB1(b) Dep. graph(c) DAGSCCA:ind1 = PHI [0, Outer_Preheader],[ind1.next, BB2]B:ind1.next = ind1 + 1c:p1 = ind1 >= ND:br p1, Sync_BlockInner_PreheaderE:r1 = A[ind1]F:r2 = B[ind1]br BB2BB2G:ind2 = PHI [r1, Inner_Preheader],[ind2.next, BB3]r4 = load TIME_STAMPPRODUCE(r4)r5 = r4 + 1store r5, TIMESTAMPPRODUCE (ind2)H:ind2.next = ind2 + 1I:p2 = ind2 > r2PRODUCE(p2)J:br p2, BB1BB3br BB2Sync_BlockPRODUCE_TO_ALL(END_TOKEN)(d) Scheduler partitionInner_Preheader'BB2't = CONSUME()p = t == END_TOKENbr p, Return_blockBB2''ind2 = CONSUME()p2 = CONSUME()br p2, Sync_BlockBB3'K:r3 = getElementPtr(C[ind2])L:call update(t3)br BB2'Sync_Block'br BB2'Return_Blockret(e) Worker partitionFigure 3.6: Running example for DOMORE code generation: (a) Pseudo IR for CG code;(b) PDG for example code. Dashed lines represent <strong>cross</strong>-iteration and <strong>cross</strong>-<strong>invocation</strong>dependences for inner loop. Solid lines represent other dependences between inner loopinstructions and outer loop instructions. (c) DAG SCC for example code. DAG SCC nodesare partitioned into scheduler and worker threads. (d) and (e) are code generated by DO-MORE MTCG algorithm (3.3.2).38

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!