This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP] Codegen for 'if' clause in 'task' directive.
ClosedPublic

Authored by ABataev on Apr 21 2015, 2:48 AM.

Details

Summary

If condition evaluates to true, the code executes task by calling @__kmpc_omp_task() runtime function.
If condition evaluates to false, the code executes serial version of the code by executing the following code:

call void @__kmpc_omp_task_begin_if0(<loc>, <threadid>, <task_t_ptr, returned by @__kmpc_omp_task_alloc()>);
proxy_task_entry(<gtid>, <task_t_ptr, returned by @__kmpc_omp_task_alloc()>);
call void @__kmpc_omp_task_complete_if0(<loc>, <threadid>, <task_t_ptr, returned by @__kmpc_omp_task_alloc()>);

Also it checks if the condition is constant and if it is constant it evaluates its value and then generates either parallel version of the code (if the condition evaluates to true), or the serial version of the code (if the condition evaluates to false).

Diff Detail

Repository
rL LLVM

Event Timeline

ABataev updated this revision to Diff 24105.Apr 21 2015, 2:48 AM
ABataev retitled this revision from to [OPENMP] Codegen for 'if' clause in 'task' directive..
ABataev updated this object.
ABataev edited the test plan for this revision. (Show Details)
ABataev added a subscriber: Unknown Object (MLST).
This revision was automatically updated to reflect the committed changes.