Analyzing Clang OpenMp work sharing for loop AST and LLVM IR

This is my summary of analyzing a simple OpenMP for loop’s Clang AST dump, if I get to it, the generated IR as well.

The c code I wrote

#include <stdio.h>

#include <omp.h>

int main()

{

int * a = malloc(sizeof(int)*100);

#pragma omp parallel for

for (int i = 0; i < 100; i++){

a[i] = i;

}

int sum = 0;

for (int i = 0; i < 100; i++){

sum += a[i];

}

printf( “sum: %d\n”, sum);

}

The generated AST dump using the following command (after running the standard set up instructions for OpenMP, adding stuff to

bin/clang -I ../pathToOpenMPInstall/  -fopenmp=libomp -Xclang -ast-dump -fsyntax-only test_ompfor.c -o toc.o

`-CompoundStmt 0x72c5fe0 <line:6:1, line:21:1>

|-DeclStmt 0x72c45d8 <line:8:3, col:36>

(int * a = malloc(sizeof(int)*100);)

    | `-VarDecl 0x72c4438 <col:3, col:35> col:9 used a ‘int *’ cinit

|   `-ImplicitCastExpr 0x72c45c0 <col:13, col:35> ‘int *’ <BitCast>

|     `-CallExpr 0x72c4590 <col:13, col:35> ‘void *’

|       |-ImplicitCastExpr 0x72c4578 <col:13> ‘void *(*)(unsigned long)’ <FunctionToPointerDecay>

|       | `-DeclRefExpr 0x72c4498 <col:13> ‘void *(unsigned long)’ Function 0x72b17e0 ‘malloc‘ ‘void *(unsigned long)’

|       `-BinaryOperator 0x72c4528 <col:20, col:32> ‘unsigned long’ ‘*’

|         |-UnaryExprOrTypeTraitExpr 0x72c44d0 <col:20, col:30> ‘unsigned long’ sizeof ‘int’

|         `-ImplicitCastExpr 0x72c4510 <col:32> ‘unsigned long’ <IntegralCast>

|           `-IntegerLiteral 0x72c44f0 <col:32> ‘int’ 100

|-OMPParallelForDirective 0x72c5a10 <line:9:11, col:27>

| |-CapturedStmt 0x72c5050 <line:10:3, line:12:3>

| | `-DeclRefExpr 0x72c4aa0 <line:11:5> ‘int *’ lvalue Var 0x72c4438 ‘a’ ‘int *’

| |-DeclRefExpr 0x72c5630 <line:10:8> ‘int’ lvalue Var 0x72c55d0 ‘.omp.iv‘ ‘int’

| |-BinaryOperator 0x72c5228 <col:3, <invalid sloc>> ‘int’ ‘-‘

| | |-BinaryOperator 0x72c51a0 <col:3, col:28> ‘int’ ‘/’

| | | |-ParenExpr 0x72c5180 <col:3> ‘int’

| | | | `-BinaryOperator 0x72c5158 <col:23, col:28> ‘int’ ‘+’

| | | |   |-BinaryOperator 0x72c5130 <col:23, <invalid sloc>> ‘int’ ‘-‘

| | | |   | |-BinaryOperator 0x72c50e8 <col:23, col:16> ‘int’ ‘-‘

| | | |   | | |-IntegerLiteral 0x72c4948 <col:23> ‘int’ 100

| | | |   | | `-IntegerLiteral 0x72c48e8 <col:16> ‘int’ 0

| | | |   | `-IntegerLiteral 0x72c5110 <<invalid sloc>> ‘int’ 1

| | | |   `-IntegerLiteral 0x72c5088 <col:28> ‘int’ 1

| | | `-IntegerLiteral 0x72c5088 <col:28> ‘int’ 1

| | `-IntegerLiteral 0x72c5208 <<invalid sloc>> ‘int’ 1

| |-<<<NULL>>>

| |-ImplicitCastExpr 0x72c50d0 <col:16, col:23> ‘_Bool’ <IntegralToBoolean>

| | `-BinaryOperator 0x72c50a8 <col:16, col:23> ‘int’ ‘<‘

| |   |-IntegerLiteral 0x72c48e8 <col:16> ‘int’ 0

| |   `-IntegerLiteral 0x72c4948 <col:23> ‘int’ 100

    | |-BinaryOperator 0x72c56c8 <col:8> ‘int’ ‘<=’ (omp.iv <= omp.ub)

| | |-ImplicitCastExpr 0x72c5698 <col:8> ‘int’ <LValueToRValue>

| | | `-DeclRefExpr 0x72c5630 <col:8> ‘int’ lvalue Var 0x72c55d0 ‘.omp.iv‘ ‘int’

| | `-ImplicitCastExpr 0x72c56b0 <col:8> ‘int’ <LValueToRValue>

| |   `-DeclRefExpr 0x72c5378 <col:8> ‘int’ lvalue Var 0x72c5318 ‘.omp.ub‘ ‘int’

| |-BinaryOperator 0x72c5670 <col:8> ‘int’ ‘=’

| | |-DeclRefExpr 0x72c5630 <col:8> ‘int’ lvalue Var 0x72c55d0 ‘.omp.iv’ ‘int’

| | `-ImplicitCastExpr 0x72c5658 <col:8> ‘int’ <LValueToRValue>

| |   `-DeclRefExpr 0x72c52c0 <col:8> ‘int’ lvalue Var 0x72c5260 ‘.omp.lb’ ‘int’

(omp.iv = omp.iv + 1, a binary =, and then a + )

    | |-BinaryOperator 0x72c5750 <col:8, <invalid sloc>> ‘int’ ‘=’

| | |-DeclRefExpr 0x72c5630 <col:8> ‘int’ lvalue Var 0x72c55d0 ‘.omp.iv‘ ‘int’

    | | `-BinaryOperator 0x72c5728 <col:8, <invalid sloc>> ‘int’ ‘+’

    | |   |-ImplicitCastExpr 0x72c5710 <col:8> ‘int’ <LValueToRValue>  (increment expression, default stride is 1)

    | |   | `-DeclRefExpr 0x72c5630 <col:8> ‘int’ lvalue Var 0x72c55d0 ‘.omp.iv’ ‘int’

    | |   `-IntegerLiteral 0x72c56f0 <<invalid sloc>> ‘int’ 1

| |-DeclRefExpr 0x72c5410 <col:8> ‘int’ lvalue Var 0x72c53b0 ‘.omp.is_last‘ ‘int’

| |-DeclRefExpr 0x72c52c0 <col:8> ‘int’ lvalue Var 0x72c5260 ‘.omp.lb‘ ‘int’

| |-DeclRefExpr 0x72c5378 <col:8> ‘int’ lvalue Var 0x72c5318 ‘.omp.ub‘ ‘int’

| |-DeclRefExpr 0x72c54c8 <col:8> ‘int’ lvalue Var 0x72c5468 ‘.omp.stride‘ ‘int’

| |-BinaryOperator 0x72c5598 <col:8> ‘int’ ‘=’

| | |-DeclRefExpr 0x72c5378 <col:8> ‘int’ lvalue Var 0x72c5318 ‘.omp.ub’ ‘int’

| | `-ConditionalOperator 0x72c5568 <col:8> ‘int’

| |   |-BinaryOperator 0x72c5528 <col:8, <invalid sloc>> ‘int’ ‘>’

| |   | |-ImplicitCastExpr 0x72c5510 <col:8> ‘int’ <LValueToRValue>

| |   | | `-DeclRefExpr 0x72c5378 <col:8> ‘int’ lvalue Var 0x72c5318 ‘.omp.ub’ ‘int’

| |   | `-BinaryOperator 0x72c5228 <col:3, <invalid sloc>> ‘int’ ‘-‘

| |   |   |-BinaryOperator 0x72c51a0 <col:3, col:28> ‘int’ ‘/’

| |   |   | |-ParenExpr 0x72c5180 <col:3> ‘int’

| |   |   | | `-BinaryOperator 0x72c5158 <col:23, col:28> ‘int’ ‘+’

| |   |   | |   |-BinaryOperator 0x72c5130 <col:23, <invalid sloc>> ‘int’ ‘-‘

| |   |   | |   | |-BinaryOperator 0x72c50e8 <col:23, col:16> ‘int’ ‘-‘

| |   |   | |   | | |-IntegerLiteral 0x72c4948 <col:23> ‘int’ 100

| |   |   | |   | | `-IntegerLiteral 0x72c48e8 <col:16> ‘int’ 0

| |   |   | |   | `-IntegerLiteral 0x72c5110 <<invalid sloc>> ‘int’ 1

| |   |   | |   `-IntegerLiteral 0x72c5088 <col:28> ‘int’ 1

| |   |   | `-IntegerLiteral 0x72c5088 <col:28> ‘int’ 1

| |   |   `-IntegerLiteral 0x72c5208 <<invalid sloc>> ‘int’ 1

| |   |-BinaryOperator 0x72c5228 <col:3, <invalid sloc>> ‘int’ ‘-‘

| |   | |-BinaryOperator 0x72c51a0 <col:3, col:28> ‘int’ ‘/’

| |   | | |-ParenExpr 0x72c5180 <col:3> ‘int’

| |   | | | `-BinaryOperator 0x72c5158 <col:23, col:28> ‘int’ ‘+’

| |   | | |   |-BinaryOperator 0x72c5130 <col:23, <invalid sloc>> ‘int’ ‘-‘

| |   | | |   | |-BinaryOperator 0x72c50e8 <col:23, col:16> ‘int’ ‘-‘

| |   | | |   | | |-IntegerLiteral 0x72c4948 <col:23> ‘int’ 100

| |   | | |   | | `-IntegerLiteral 0x72c48e8 <col:16> ‘int’ 0

| |   | | |   | `-IntegerLiteral 0x72c5110 <<invalid sloc>> ‘int’ 1

| |   | | |   `-IntegerLiteral 0x72c5088 <col:28> ‘int’ 1

| |   | | `-IntegerLiteral 0x72c5088 <col:28> ‘int’ 1

| |   | `-IntegerLiteral 0x72c5208 <<invalid sloc>> ‘int’ 1

| |   `-ImplicitCastExpr 0x72c5550 <col:8> ‘int’ <LValueToRValue>

| |     `-DeclRefExpr 0x72c5378 <col:8> ‘int’ lvalue Var 0x72c5318 ‘.omp.ub’ ‘int’

    | |-BinaryOperator 0x72c57d0 <col:8> ‘int’ ‘=’

| | |-DeclRefExpr 0x72c52c0 <col:8> ‘int’ lvalue Var 0x72c5260 ‘.omp.lb‘ ‘int’

| | `-BinaryOperator 0x72c57a8 <col:8> ‘int’ ‘+’

| |   |-ImplicitCastExpr 0x72c5778 <col:8> ‘int’ <LValueToRValue>

| |   | `-DeclRefExpr 0x72c52c0 <col:8> ‘int’ lvalue Var 0x72c5260 ‘.omp.lb‘ ‘int’

| |   `-ImplicitCastExpr 0x72c5790 <col:8> ‘int’ <LValueToRValue>

| |     `-DeclRefExpr 0x72c54c8 <col:8> ‘int’ lvalue Var 0x72c5468 ‘.omp.stride‘ ‘int’

    | |-BinaryOperator 0x72c5850 <col:8> ‘int’ ‘=’

| | |-DeclRefExpr 0x72c5378 <col:8> ‘int’ lvalue Var 0x72c5318 ‘.omp.ub’ ‘int’

| | `-BinaryOperator 0x72c5828 <col:8> ‘int’ ‘+’

| |   |-ImplicitCastExpr 0x72c57f8 <col:8> ‘int’ <LValueToRValue>

| |   | `-DeclRefExpr 0x72c5378 <col:8> ‘int’ lvalue Var 0x72c5318 ‘.omp.ub’ ‘int’

| |   `-ImplicitCastExpr 0x72c5810 <col:8> ‘int’ <LValueToRValue>

    | |     `-DeclRefExpr 0x72c54c8 <col:8> ‘int’ lvalue Var 0x72c5468 ‘.omp.stride’ ‘int’

| |-DeclRefExpr 0x72c51c8 <col:3> ‘int’ lvalue Var 0x72c4888 ‘i’ ‘int’

| |-BinaryOperator 0x72c58a0 <col:3, col:16> ‘int’ ‘=’

| | |-DeclRefExpr 0x72c5878 <col:3> ‘int’ lvalue Var 0x72c4888 ‘i’ ‘int’

| | `-IntegerLiteral 0x72c48e8 <col:16> ‘int’ 0

| |-BinaryOperator 0x72c5950 <col:3, col:28> ‘int’ ‘=’

| | |-DeclRefExpr 0x72c5878 <col:3> ‘int’ lvalue Var 0x72c4888 ‘i’ ‘int’

| | `-BinaryOperator 0x72c5928 <col:16, col:28> ‘int’ ‘+’

| |   |-IntegerLiteral 0x72c48e8 <col:16> ‘int’ 0

| |   `-BinaryOperator 0x72c5900 <col:28> ‘int’ ‘*’

| |     |-ImplicitCastExpr 0x72c58e8 <col:28> ‘int’ <LValueToRValue>

| |     | `-ParenExpr 0x72c58c8 <col:28> ‘int’ lvalue

| |     |   `-DeclRefExpr 0x72c5630 <col:8> ‘int’ lvalue Var 0x72c55d0 ‘.omp.iv’ ‘int’

| |     `-IntegerLiteral 0x72c5088 <col:28> ‘int’ 1

| `-BinaryOperator 0x72c59e8 <col:3, col:28> ‘int’ ‘=’

|   |-DeclRefExpr 0x72c5878 <col:3> ‘int’ lvalue Var 0x72c4888 ‘i’ ‘int’

|   `-BinaryOperator 0x72c59c0 <col:16, col:28> ‘int’ ‘+’

|     |-IntegerLiteral 0x72c48e8 <col:16> ‘int’ 0

|     `-BinaryOperator 0x72c5998 <col:28> ‘int’ ‘*’

|       |-ParenExpr 0x72c5978 <col:28> ‘int’

|       | `-BinaryOperator 0x72c51a0 <col:3, col:28> ‘int’ ‘/’

|       |   |-ParenExpr 0x72c5180 <col:3> ‘int’

|       |   | `-BinaryOperator 0x72c5158 <col:23, col:28> ‘int’ ‘+’

|       |   |   |-BinaryOperator 0x72c5130 <col:23, <invalid sloc>> ‘int’ ‘-‘

|       |   |   | |-BinaryOperator 0x72c50e8 <col:23, col:16> ‘int’ ‘-‘

|       |   |   | | |-IntegerLiteral 0x72c4948 <col:23> ‘int’ 100

|       |   |   | | `-IntegerLiteral 0x72c48e8 <col:16> ‘int’ 0

|       |   |   | `-IntegerLiteral 0x72c5110 <<invalid sloc>> ‘int’ 1

|       |   |   `-IntegerLiteral 0x72c5088 <col:28> ‘int’ 1

|       |   `-IntegerLiteral 0x72c5088 <col:28> ‘int’ 1

|       `-IntegerLiteral 0x72c5088 <col:28> ‘int’ 1

|-DeclStmt 0x72c5b58 <line:14:3, col:14>

| `-VarDecl 0x72c5ad8 <col:3, col:13> col:7 used sum ‘int’ cinit

|   `-IntegerLiteral 0x72c5b38 <col:13> ‘int’ 0

    |-ForStmt 0x72c5e28 <line:15:3, line:17:3> (the validation for loop after openmp for loop)

| |-DeclStmt 0x72c5c00 <line:15:8, col:17>

| | `-VarDecl 0x72c5b80 <col:8, col:16> col:12 used i ‘int’ cinit

| |   `-IntegerLiteral 0x72c5be0 <col:16> ‘int’ 0

| |-<<<NULL>>>

| |-BinaryOperator 0x72c5c78 <col:19, col:23> ‘int’ ‘<‘

| | |-ImplicitCastExpr 0x72c5c60 <col:19> ‘int’ <LValueToRValue>

| | | `-DeclRefExpr 0x72c5c18 <col:19> ‘int’ lvalue Var 0x72c5b80 ‘i’ ‘int’

| | `-IntegerLiteral 0x72c5c40 <col:23> ‘int’ 100

| |-UnaryOperator 0x72c5cc8 <col:28, col:29> ‘int’ postfix ‘++’

| | `-DeclRefExpr 0x72c5ca0 <col:28> ‘int’ lvalue Var 0x72c5b80 ‘i’ ‘int’

| `-CompoundStmt 0x72c5e08 <col:32, line:17:3>

|   `-CompoundAssignOperator 0x72c5dd0 <line:16:5, col:15> ‘int’ ‘+=’ ComputeLHSTy=’int’ ComputeResultTy=’int’

|     |-DeclRefExpr 0x72c5ce8 <col:5> ‘int’ lvalue Var 0x72c5ad8 ‘sum’ ‘int’

|     `-ImplicitCastExpr 0x72c5db8 <col:12, col:15> ‘int’ <LValueToRValue>

|       `-ArraySubscriptExpr 0x72c5d90 <col:12, col:15> ‘int’ lvalue

|         |-ImplicitCastExpr 0x72c5d60 <col:12> ‘int *’ <LValueToRValue>

|         | `-DeclRefExpr 0x72c5d10 <col:12> ‘int *’ lvalue Var 0x72c4438 ‘a’ ‘int *’

|         `-ImplicitCastExpr 0x72c5d78 <col:14> ‘int’ <LValueToRValue>

|           `-DeclRefExpr 0x72c5d38 <col:14> ‘int’ lvalue Var 0x72c5b80 ‘i’ ‘int’

`-CallExpr 0x72c5f60 <line:19:3, col:27> ‘int’

|-ImplicitCastExpr 0x72c5f48 <col:3> ‘int (*)(const char *, …)’ <FunctionToPointerDecay>

      | `-DeclRefExpr 0x72c5e60 <col:3> ‘int (const char *, …)’ Function 0x725c188 ‘printf’ ‘int (const char *, …)’

|-ImplicitCastExpr 0x72c5fb0 <col:11> ‘const char *’ <BitCast>

| `-ImplicitCastExpr 0x72c5f98 <col:11> ‘char *’ <ArrayToPointerDecay>

|   `-StringLiteral 0x72c5ec8 <col:11> ‘char [9]’ lvalue “sum: %d\n”

`-ImplicitCastExpr 0x72c5fc8 <col:24> ‘int’ <LValueToRValue>

`-DeclRefExpr 0x72c5ef8 <col:24> ‘int’ lvalue Var 0x72c5ad8 ‘sum’ ‘int’

omp.iv is the iteration variable that is used for checking the upper bound, increment by stride.

The generated LLVM IR code

%ident_t = type { i32, i32, i32, i32, i8* }

%struct.anon = type { i32** }

@.str = private unnamed_addr constant [23 x i8] c”;unknown;unknown;0;0;;\00″, align 1

@0 = private unnamed_addr constant %ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr\

inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 0) }

@1 = private unnamed_addr constant %ident_t { i32 0, i32 66, i32 0, i32 0, i8* getelementpt\

r inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 0) }

@.str.1 = private unnamed_addr constant [9 x i8] c”sum: %d\0A\00″, align 1

; Function Attrs: nounwind uwtable

define i32 @main() #0 {

entry:

%retval = alloca i32, align 4

%a = alloca i32*, align 8

%agg.captured = alloca %struct.anon, align 8

%sum = alloca i32, align 4

%i = alloca i32, align 4

store i32 0, i32* %retval

%call = call noalias i8* @malloc(i64 400) #3

%0 = bitcast i8* %call to i32*

store i32* %0, i32** %a, align 8

%1 = getelementptr inbounds %struct.anon, %struct.anon* %agg.captured, i32 0, i32 0

store i32** %a, i32*** %1, align 8

%2 = bitcast %struct.anon* %agg.captured to i8*

call void (%ident_t*, i32, void (i32*, i32*, …)*, …) @__kmpc_fork_call(%ident_t* @0, \

i32 1, void (i32*, i32*, …)* bitcast (void (i32*, i32*, %struct.anon*)* @.omp_outlined. t\

o void (i32*, i32*, …)*), i8* %2)

store i32 0, i32* %sum, align 4

store i32 0, i32* %i, align 4

br label %for.cond

for.cond:                                         ; preds = %for.inc, %entry

%3 = load i32, i32* %i, align 4

%cmp = icmp slt i32 %3, 100

br i1 %cmp, label %for.body, label %for.end

for.body:                                         ; preds = %for.cond

%4 = load i32, i32* %i, align 4

%idxprom = sext i32 %4 to i64

%5 = load i32*, i32** %a, align 8

%arrayidx = getelementptr inbounds i32, i32* %5, i64 %idxprom

%6 = load i32, i32* %arrayidx, align 4

%7 = load i32, i32* %sum, align 4

%add = add nsw i32 %7, %6

store i32 %add, i32* %sum, align 4

br label %for.inc

for.inc:                                          ; preds = %for.body

%8 = load i32, i32* %i, align 4

%add1 = add nsw i32 %8, 1

store i32 %add1, i32* %i, align 4

br label %for.cond

for.end:                                          ; preds = %for.cond

%9 = load i32, i32* %sum, align 4

%call2 = call i32 (i8*, …) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.st\

r.1, i32 0, i32 0), i32 %9)

%10 = load i32, i32* %retval

ret i32 %10

}

; Function Attrs: nounwind

declare noalias i8* @malloc(i64) #1

; Function Attrs: nounwind uwtable

define internal void @.omp_outlined.(i32* %.global_tid., i32* %.bound_tid., %struct.anon* %\

__context) #0 {

entry:

%.global_tid..addr = alloca i32*, align 8

%.bound_tid..addr = alloca i32*, align 8

%__context.addr = alloca %struct.anon*, align 8

%.omp.iv = alloca i32, align 4

%.omp.lb = alloca i32, align 4

%.omp.ub = alloca i32, align 4

%.omp.stride = alloca i32, align 4

%.omp.is_last = alloca i32, align 4

%i = alloca i32, align 4

store i32* %.global_tid., i32** %.global_tid..addr, align 8

store i32* %.bound_tid., i32** %.bound_tid..addr, align 8

store %struct.anon* %__context, %struct.anon** %__context.addr, align 8

%0 = load %struct.anon*, %struct.anon** %__context.addr

store i32 0, i32* %.omp.lb, align 4

store i32 99, i32* %.omp.ub, align 4

store i32 1, i32* %.omp.stride, align 4

store i32 0, i32* %.omp.is_last, align 4

%1 = load i32*, i32** %.global_tid..addr, align 8

%2 = load i32, i32* %1, align 4

call void @__kmpc_for_static_init_4(%ident_t* @0, i32 %2, i32 34, i32* %.omp.is_last, i32\

(It seems that it just calls this kmpc_for_static_init function to calculated the lower bound and upper bound)

* %.omp.lb, i32* %.omp.ub, i32* %.omp.stride, i32 1, i32 1)

%3 = load i32, i32* %.omp.ub, align 4

%cmp = icmp sgt i32 %3, 99

br i1 %cmp, label %cond.true, label %cond.false

cond.true:                                        ; preds = %entry

br label %cond.end

cond.false:                                       ; preds = %entry

%4 = load i32, i32* %.omp.ub, align 4

br label %cond.end

cond.end:                                         ; preds = %cond.false, %cond.true

%cond = phi i32 [ 99, %cond.true ], [ %4, %cond.false ]

store i32 %cond, i32* %.omp.ub, align 4

%5 = load i32, i32* %.omp.lb, align 4

store i32 %5, i32* %.omp.iv, align 4

br label %omp.inner.for.cond

omp.inner.for.cond:                               ; preds = %omp.inner.for.inc, %cond.end

%6 = load i32, i32* %.omp.iv, align 4

%7 = load i32, i32* %.omp.ub, align 4

%cmp1 = icmp sle i32 %6, %7

br i1 %cmp1, label %omp.inner.for.body, label %omp.inner.for.end

omp.inner.for.body:                               ; preds = %omp.inner.for.cond

%8 = load i32, i32* %.omp.iv, align 4

%mul = mul nsw i32 %8, 1

%add = add nsw i32 0, %mul

store i32 %add, i32* %i, align 4

%9 = load i32, i32* %i, align 4

%10 = load i32, i32* %i, align 4

%idxprom = sext i32 %10 to i64

%11 = getelementptr inbounds %struct.anon, %struct.anon* %0, i32 0, i32 0

%ref = load i32**, i32*** %11, align 8

%12 = load i32*, i32** %ref, align 8

%arrayidx = getelementptr inbounds i32, i32* %12, i64 %idxprom

store i32 %9, i32* %arrayidx, align 4

br label %omp.body.continue

omp.body.continue:                                ; preds = %omp.inner.for.body

br label %omp.inner.for.inc

omp.inner.for.inc:                                ; preds = %omp.body.continue

%13 = load i32, i32* %.omp.iv, align 4

%add2 = add nsw i32 %13, 1

store i32 %add2, i32* %.omp.iv, align 4

br label %omp.inner.for.cond

omp.inner.for.end:                                ; preds = %omp.inner.for.cond

br label %omp.loop.exit

omp.loop.exit:                                    ; preds = %omp.inner.for.end

call void @__kmpc_for_static_fini(%ident_t* @0, i32 %2)

call void @__kmpc_barrier(%ident_t* @1, i32 %2)

ret void

}

declare void @__kmpc_for_static_init_4(%ident_t*, i32, i32, i32*, i32*, i32*, i32*, i32, i3\

2)

declare void @__kmpc_for_static_fini(%ident_t*, i32)

declare void @__kmpc_barrier(%ident_t*, i32)

declare void @__kmpc_fork_call(%ident_t*, i32, void (i32*, i32*, …)*, …)

declare i32 @printf(i8*, …) #2

Advertisements
This entry was posted in Tools and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s