[llvm] [OpenMPIRBuilder] Added `createTeams` (PR #65785)

Kiran Chandramohan via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 15 10:50:20 PDT 2023


kiranchandramohan wrote:


```
kiranchandramohan: Is this a change from clang codegen? Why not runtime_call(..., outlined_fn, ...)? Can you say that explicitly in the summary that this is different from Clang if it was changed for a particular reason?

shraiysh: The main reason for a difference is that Outlining generates a function call as shown in the input IR in the comment above. I could not find an easy way to change the arguments of a function after it has been constructed. Parallel does this by tweaking the CodeExtractor used inside outlining - and I did not want to touch outlining internally so that I can confidently rely on outlining to do its job.A nice way to have similar (but not same) behavior as clang would be to add the inline attribute to the outlined function. After an Inline pass, the wrapper function will become the outlined function and it will be almost identical to clang's codegen. I will update the summary to highlight this difference.

Meinersbur: Could you add the function signature differences between wrapper_fn and outlined_fn? I.e. what arguments does wrapper_fn throw away?
Btw, current Clang emits such a wrapper function with -g as well, so I don't see it as an issue. LLVM will always inline a private function with just a single call site, except in -O0 where always_inline would be needed.
```

https://github.com/llvm/llvm-project/pull/65785


More information about the llvm-commits mailing list