[PATCH] D69930: [OpenMP] Introduce the OpenMPOpt transformation pass
Wenlei He via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 24 21:32:17 PST 2020
wenlei added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/OpenMPOpt.cpp:159
+ if (CallInst *CI = getCallIfRegularCall(*U, &RFI)) {
+ CI->moveBefore(&*F.getEntryBlock().getFirstInsertionPt());
+ ReplVal = CI;
----------------
I think you need to make sure it's not moved before the def of the operand for openmp calls.
I'm seeing a case where `__kmpc_global_thread_num` has a parameter, and the call is moved to before def of parameter, see snippet below.
```
%5 = call i32 @__kmpc_global_thread_num(%struct.ident_t* nonnull %6)
%6 = alloca %struct.ident_t, align 8
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69930/new/
https://reviews.llvm.org/D69930
More information about the llvm-commits
mailing list