Commit f8b347b
committed
[OpenMP] Improve debug info generation for outlined function.
In OMPIRBuilder, a new function is created for the TargetOp. We also
create a new DISubprogram for it. All the variables that were in the
target region now have to be updated to have the correct scope. This
after the fact updating of debug information becomes very difficult in
certain cases.
This PR is making the change that OMPIRBuilder will not generate a
DISubprogram. The responsibility has been shifted to the frontend. This
allows us to simplify the updating of debug records.
The PR is made a bit more complicated by the the fact that in new
scheme, the debug location already points to the new DISubprogram by
the time it reaches convertOmpTarget. But we need some code generation
in the parent function so we have to carefully manage the debug
locations.
This builds on `llvm#138039` and fixes issue `llvm#134991`.1 parent d8e8ab7 commit f8b347b
File tree
8 files changed
+63
-55
lines changed- llvm/lib/Frontend/OpenMP
- mlir
- lib/Target/LLVMIR/Dialect/OpenMP
- test/Target/LLVMIR
8 files changed
+63
-55
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6887 | 6887 | | |
6888 | 6888 | | |
6889 | 6889 | | |
6890 | | - | |
6891 | 6890 | | |
6892 | 6891 | | |
6893 | 6892 | | |
6894 | | - | |
6895 | 6893 | | |
6896 | 6894 | | |
6897 | 6895 | | |
6898 | 6896 | | |
6899 | 6897 | | |
6900 | 6898 | | |
6901 | | - | |
6902 | | - | |
6903 | 6899 | | |
6904 | | - | |
6905 | | - | |
6906 | | - | |
| 6900 | + | |
| 6901 | + | |
| 6902 | + | |
6907 | 6903 | | |
6908 | 6904 | | |
6909 | 6905 | | |
| |||
6917 | 6913 | | |
6918 | 6914 | | |
6919 | 6915 | | |
6920 | | - | |
| 6916 | + | |
| 6917 | + | |
6921 | 6918 | | |
6922 | 6919 | | |
6923 | 6920 | | |
| |||
6996 | 6993 | | |
6997 | 6994 | | |
6998 | 6995 | | |
6999 | | - | |
7000 | | - | |
7001 | | - | |
7002 | | - | |
7003 | | - | |
7004 | | - | |
7005 | | - | |
7006 | | - | |
7007 | | - | |
7008 | | - | |
7009 | | - | |
7010 | | - | |
7011 | | - | |
7012 | | - | |
7013 | | - | |
7014 | | - | |
7015 | | - | |
7016 | | - | |
7017 | | - | |
7018 | | - | |
7019 | | - | |
7020 | | - | |
7021 | | - | |
7022 | | - | |
7023 | | - | |
7024 | | - | |
7025 | | - | |
7026 | | - | |
7027 | | - | |
7028 | | - | |
| 6996 | + | |
| 6997 | + | |
| 6998 | + | |
7029 | 6999 | | |
7030 | 7000 | | |
7031 | 7001 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5299 | 5299 | | |
5300 | 5300 | | |
5301 | 5301 | | |
| 5302 | + | |
| 5303 | + | |
| 5304 | + | |
| 5305 | + | |
| 5306 | + | |
| 5307 | + | |
| 5308 | + | |
| 5309 | + | |
| 5310 | + | |
| 5311 | + | |
| 5312 | + | |
| 5313 | + | |
| 5314 | + | |
| 5315 | + | |
5302 | 5316 | | |
5303 | 5317 | | |
5304 | 5318 | | |
| |||
5395 | 5409 | | |
5396 | 5410 | | |
5397 | 5411 | | |
| 5412 | + | |
| 5413 | + | |
| 5414 | + | |
5398 | 5415 | | |
5399 | 5416 | | |
5400 | 5417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| 42 | + | |
40 | 43 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
25 | 27 | | |
26 | | - | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | | - | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| 62 | + | |
60 | 63 | | |
61 | | - | |
| 64 | + | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
25 | 27 | | |
26 | | - | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | | - | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| 60 | + | |
58 | 61 | | |
59 | | - | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| 30 | + | |
27 | 31 | | |
28 | | - | |
| 32 | + | |
29 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| 31 | + | |
28 | 32 | | |
29 | | - | |
| 33 | + | |
30 | 34 | | |
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | | - | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | | - | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
0 commit comments