Commit c5ea469
authored
[OMPIRBuilder] - Fix emitTargetTaskProxyFunc to not generate empty functions (#126958)
This is a fix for #126949
There are two issues being fixed here.
First, in some cases, OMPIRBuilder generates empty target task proxy functions. This happens
when the target kernel doesn't use any stack-allocated data (either no data or only globals).
The second problem is encountered when the target task i.e the code that makes the target call
spans a single basic block. This usually happens when we do not generate a target or device kernel
launch and instead fall back to the host. In such cases, we end up not outlining the target task entirely.
This can cause us to call target kernel twice - once via the target task proxy function and a second time
via the host fallback
This PR fixes both of these problems and updates some tests to catch these problems should this patch fail.1 parent 6c62783 commit c5ea469
File tree
3 files changed
+65
-7
lines changed- llvm/lib/Frontend/OpenMP
- mlir/test/Target/LLVMIR
3 files changed
+65
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7099 | 7099 | | |
7100 | 7100 | | |
7101 | 7101 | | |
7102 | | - | |
7103 | | - | |
7104 | | - | |
7105 | | - | |
| 7102 | + | |
| 7103 | + | |
| 7104 | + | |
| 7105 | + | |
| 7106 | + | |
7106 | 7107 | | |
7107 | 7108 | | |
7108 | 7109 | | |
| |||
7140 | 7141 | | |
7141 | 7142 | | |
7142 | 7143 | | |
| 7144 | + | |
| 7145 | + | |
7143 | 7146 | | |
7144 | 7147 | | |
7145 | 7148 | | |
| |||
7150 | 7153 | | |
7151 | 7154 | | |
7152 | 7155 | | |
7153 | | - | |
7154 | 7156 | | |
7155 | 7157 | | |
7156 | 7158 | | |
| |||
7163 | 7165 | | |
7164 | 7166 | | |
7165 | 7167 | | |
| 7168 | + | |
| 7169 | + | |
7166 | 7170 | | |
| 7171 | + | |
7167 | 7172 | | |
7168 | 7173 | | |
7169 | 7174 | | |
| |||
7306 | 7311 | | |
7307 | 7312 | | |
7308 | 7313 | | |
7309 | | - | |
7310 | 7314 | | |
7311 | 7315 | | |
7312 | 7316 | | |
7313 | | - | |
| 7317 | + | |
| 7318 | + | |
| 7319 | + | |
| 7320 | + | |
| 7321 | + | |
| 7322 | + | |
| 7323 | + | |
| 7324 | + | |
| 7325 | + | |
| 7326 | + | |
| 7327 | + | |
| 7328 | + | |
| 7329 | + | |
| 7330 | + | |
7314 | 7331 | | |
7315 | 7332 | | |
7316 | 7333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
28 | 42 | | |
| 43 | + | |
| 44 | + | |
29 | 45 | | |
30 | 46 | | |
| 47 | + | |
31 | 48 | | |
32 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
23 | 36 | | |
24 | 37 | | |
| 38 | + | |
25 | 39 | | |
| 40 | + | |
| 41 | + | |
26 | 42 | | |
27 | 43 | | |
28 | 44 | | |
29 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
0 commit comments