Page MenuHomePhabricator

sdmitriev (Sergey Dmitriev)
User

Projects

User does not belong to any projects.

User Details

User Since
Dec 7 2016, 2:42 PM (162 w, 4 d)

Recent Activity

Fri, Jan 17

sdmitriev updated the diff for D72128: [llvm-objcopy][ELF] Allow setting SHF_EXCLUDE flag for ELF sections.

Addressed review comments.

Fri, Jan 17, 4:35 AM · Restricted Project
sdmitriev added inline comments to D72128: [llvm-objcopy][ELF] Allow setting SHF_EXCLUDE flag for ELF sections.
Fri, Jan 17, 2:01 AM · Restricted Project

Thu, Jan 16

sdmitriev added inline comments to D72128: [llvm-objcopy][ELF] Allow setting SHF_EXCLUDE flag for ELF sections.
Thu, Jan 16, 5:27 AM · Restricted Project

Wed, Jan 15

sdmitriev added inline comments to D72128: [llvm-objcopy][ELF] Allow setting SHF_EXCLUDE flag for ELF sections.
Wed, Jan 15, 11:21 PM · Restricted Project
sdmitriev updated the diff for D72128: [llvm-objcopy][ELF] Allow setting SHF_EXCLUDE flag for ELF sections.

Rebased and addressed review comments.

Wed, Jan 15, 11:21 PM · Restricted Project

Sat, Jan 4

sdmitriev added a comment to D72128: [llvm-objcopy][ELF] Allow setting SHF_EXCLUDE flag for ELF sections.

As you probably know llvm-objcopy tool is used by another tool clang-offload-wrapper for creating fat object files (when OpenMP offloading is enabled). Fat object is really just a normal host object file with few extra sections (one section per each offload target) which contain target object as data. Clang-offload-bundler uses llvm-objcopy for adding target sections to the fat output.

Does clang-offload-wrapper add SHF_EXCLUDE sections with llvm-objcopy?

Sat, Jan 4, 10:44 PM · Restricted Project

Fri, Jan 3

sdmitriev updated the diff for D72128: [llvm-objcopy][ELF] Allow setting SHF_EXCLUDE flag for ELF sections.

Addressed review comment.

Fri, Jan 3, 11:11 PM · Restricted Project
sdmitriev added a comment to D72128: [llvm-objcopy][ELF] Allow setting SHF_EXCLUDE flag for ELF sections.

I'm assuming that GNU objcopy doesn't have this flag? Also, what is your use-case for adding it?

I think this is a perfectly reasonable extension to llvm-objcopy if there's a valid use-case, but in some cases it might just be more appropriate to remove the section.

Fri, Jan 3, 10:52 PM · Restricted Project
Herald added a reviewer for D72128: [llvm-objcopy][ELF] Allow setting SHF_EXCLUDE flag for ELF sections: alexshap.
Fri, Jan 3, 12:53 AM · Restricted Project

Thu, Jan 2

sdmitriev added inline comments to D61446: Generalize the pass registration mechanism used by Polly to any third-party tool.
Thu, Jan 2, 8:54 PM · Restricted Project, Restricted Project

Nov 22 2019

sdmitriev abandoned D70551: [clang-offload-wrapper] Add data layout to the wrapper bitcode.
Nov 22 2019, 1:57 PM · Restricted Project
sdmitriev added a comment to D70551: [clang-offload-wrapper] Add data layout to the wrapper bitcode.

Wrapper tool is invoked at link phase, therefore there just could be no .bc files available to read data layout from. Ok, looks like there is no good solution for the data layout problem, so I will drop the idea of passing wrapper .bc directly to the linker when LTO is enabled (at least for now:). I will abandon this patch.

Nov 22 2019, 11:20 AM · Restricted Project
sdmitriev added a comment to D70551: [clang-offload-wrapper] Add data layout to the wrapper bitcode.

I would agree with you if data layout was indeed available in the driver, but unfortunately driver does not have access to any existing TargetInfo instance (or maybe I just have not found it). So, I have to create TargetInfo and build data layout even for the case when driver passes it to the wrapper tool. I guess that would also be a default data layout, so it would not differ much from what I have already done in this patch. BTW, I will probably upload an alternative patch where I have implemented your suggestion, just to compare))

Nov 22 2019, 10:16 AM · Restricted Project
sdmitriev added a comment to D70551: [clang-offload-wrapper] Add data layout to the wrapper bitcode.

Ok, it is possible to do it like you suggested, but I think that teaching wrapper tool to set data layout without external help is more preferable. There is a certain difference between opt and wrapper tool – opt works on the existing .bc that is provided in command line and data-layout option just gives user an optional way to override input’s data layout while wrapper tool creates output .bc from scratch. With your proposal, data-layout would become sort of mandatory option for the wrapper tool which is not very convenient. I believe wrapper tool should be able to set it without external help, and we can always add an option to override data layout (similar to opt) if there would be a need for that.

Nov 22 2019, 9:40 AM · Restricted Project

Nov 21 2019

sdmitriev added a comment to D70551: [clang-offload-wrapper] Add data layout to the wrapper bitcode.

Why do we need this?

To pass wrapper bitcode directly to the linker when LTO is enabled. LTO plugin does not accept bc if there is no data layout.

Maybe it would better to pass it a parameter just like for opt?

In this case clang driver would need to get it from somewhere in order to pass it to the wrapper tool. I do not know where it can get it from.

TargetInfo class is not accessible in the driver?

Nov 21 2019, 2:03 PM · Restricted Project
sdmitriev added a comment to D70551: [clang-offload-wrapper] Add data layout to the wrapper bitcode.

Why do we need this?

To pass wrapper bitcode directly to the linker when LTO is enabled. LTO plugin does not accept bc if there is no data layout.

Maybe it would better to pass it a parameter just like for opt?

Nov 21 2019, 1:35 PM · Restricted Project
sdmitriev added a comment to D70551: [clang-offload-wrapper] Add data layout to the wrapper bitcode.

Why do we need this?

Nov 21 2019, 11:27 AM · Restricted Project
sdmitriev created D70551: [clang-offload-wrapper] Add data layout to the wrapper bitcode.
Nov 21 2019, 10:41 AM · Restricted Project

Nov 15 2019

sdmitriev committed rG840c891a8c24: [llvm-objcopy][NFC] Use generated object file in COFF/add-section.test (authored by sdmitriev).
[llvm-objcopy][NFC] Use generated object file in COFF/add-section.test
Nov 15 2019, 8:18 AM
sdmitriev closed D70269: [llvm-objcopy][NFC] Use generated object file in COFF/add-section.test.
Nov 15 2019, 8:18 AM · Restricted Project

Nov 14 2019

sdmitriev created D70269: [llvm-objcopy][NFC] Use generated object file in COFF/add-section.test.
Nov 14 2019, 1:20 PM · Restricted Project
sdmitriev committed rG4d02263af0d5: [yaml2obj][COFF] Add support for extended relocation tables (authored by sdmitriev).
[yaml2obj][COFF] Add support for extended relocation tables
Nov 14 2019, 12:53 PM
sdmitriev closed D70251: [yaml2obj][COFF] Add support for extended relocation tables.
Nov 14 2019, 12:52 PM · Restricted Project
sdmitriev added inline comments to D70251: [yaml2obj][COFF] Add support for extended relocation tables.
Nov 14 2019, 11:29 AM · Restricted Project
sdmitriev updated the diff for D70251: [yaml2obj][COFF] Add support for extended relocation tables.

Addressed review comments.

Nov 14 2019, 11:29 AM · Restricted Project
sdmitriev committed rGcaa9493da855: [llvm-objcopy][COFF] Add support for extended relocation tables (authored by sdmitriev).
[llvm-objcopy][COFF] Add support for extended relocation tables
Nov 14 2019, 10:43 AM
sdmitriev closed D70205: [llvm-objcopy][COFF] Add support for extended relocation tables.
Nov 14 2019, 10:43 AM · Restricted Project
sdmitriev added a comment to D70205: [llvm-objcopy][COFF] Add support for extended relocation tables.

I think using generated object in the test is more preferable since yaml definition can be adjust if there would be a need for that, but it turned out that yaml2obj tool also has problems with COFF’s extended relocation tables. I have prepared a patch to fix this problem in the yaml2obj – D70251

Nov 14 2019, 9:38 AM · Restricted Project
sdmitriev created D70251: [yaml2obj][COFF] Add support for extended relocation tables.
Nov 14 2019, 9:38 AM · Restricted Project

Nov 13 2019

sdmitriev updated the diff for D70205: [llvm-objcopy][COFF] Add support for extended relocation tables.

Added real object with extended relocations for LIT test.

Nov 13 2019, 3:36 PM · Restricted Project
sdmitriev created D70205: [llvm-objcopy][COFF] Add support for extended relocation tables.
Nov 13 2019, 1:43 PM · Restricted Project

Nov 5 2019

sdmitriev committed rG82588e05cc32: [SLP] - Add couple safety checks to TreeEntry::dump(). NFC (authored by sdmitriev).
[SLP] - Add couple safety checks to TreeEntry::dump(). NFC
Nov 5 2019, 10:01 AM
sdmitriev closed D69812: [SLP] - Add couple safety checks to TreeEntry::dump(). NFC.
Nov 5 2019, 10:01 AM · Restricted Project

Oct 25 2019

sdmitriev committed rGedb1a1de1b79: Reland "[Clang][Bundler] Error reporting improvements" (authored by sdmitriev).
Reland "[Clang][Bundler] Error reporting improvements"
Oct 25 2019, 7:33 PM
sdmitriev committed rG93b29d3882ba: Revert "[Clang][Bundler] Error reporting improvements" (authored by sdmitriev).
Revert "[Clang][Bundler] Error reporting improvements"
Oct 25 2019, 6:01 PM
sdmitriev added a reverting change for rGdd501045cdea: [Clang][Bundler] Error reporting improvements: rG93b29d3882ba: Revert "[Clang][Bundler] Error reporting improvements".
Oct 25 2019, 6:01 PM
sdmitriev committed rGdd501045cdea: [Clang][Bundler] Error reporting improvements (authored by sdmitriev).
[Clang][Bundler] Error reporting improvements
Oct 25 2019, 4:38 PM
sdmitriev closed D67031: [Clang][Bundler] Error reporting improvements.
Oct 25 2019, 4:38 PM · Restricted Project

Oct 22 2019

sdmitriev added inline comments to D67031: [Clang][Bundler] Error reporting improvements.
Oct 22 2019, 10:31 PM · Restricted Project

Oct 17 2019

sdmitriev committed rG6caada4eb465: [clang-offload-wrapper][NFC] Use captured name of the entry type in LIT test (authored by sdmitriev).
[clang-offload-wrapper][NFC] Use captured name of the entry type in LIT test
Oct 17 2019, 2:57 PM
sdmitriev closed D69140: [clang-offload-wrapper][NFC] Use captured name of the entry type in LIT test.
Oct 17 2019, 2:57 PM · Restricted Project
sdmitriev committed rL375177: [clang-offload-wrapper][NFC] Use captured name of the entry type in LIT test.
[clang-offload-wrapper][NFC] Use captured name of the entry type in LIT test
Oct 17 2019, 2:57 PM
sdmitriev created D69140: [clang-offload-wrapper][NFC] Use captured name of the entry type in LIT test.
Oct 17 2019, 2:37 PM · Restricted Project
sdmitriev added inline comments to D68438: [gicombiner] Add the run-time rule disable option.
Oct 17 2019, 10:14 AM · Restricted Project

Oct 16 2019

sdmitriev abandoned D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script.

All three parts have been committed, so I am abandoning the original patch.

Oct 16 2019, 1:59 PM

Oct 15 2019

sdmitriev committed rG5836c356fa6e: [Clang][OpenMP Offload] Move offload registration code to the wrapper (authored by sdmitriev).
[Clang][OpenMP Offload] Move offload registration code to the wrapper
Oct 15 2019, 11:46 AM
sdmitriev committed rL374937: [Clang][OpenMP Offload] Move offload registration code to the wrapper.
[Clang][OpenMP Offload] Move offload registration code to the wrapper
Oct 15 2019, 11:45 AM
sdmitriev closed D68746: [Clang][OpenMP Offload] Move offload registration code to the wrapper.
Oct 15 2019, 11:45 AM · Restricted Project

Oct 13 2019

sdmitriev accepted D68931: [clang] [clang-offload-bundler] Fix finding installed llvm-objcopy.

Looks good.

Oct 13 2019, 8:32 PM · Restricted Project

Oct 11 2019

sdmitriev added inline comments to D67031: [Clang][Bundler] Error reporting improvements.
Oct 11 2019, 8:22 PM · Restricted Project
sdmitriev updated the diff for D67031: [Clang][Bundler] Error reporting improvements.

Rebased patch.

Oct 11 2019, 8:13 PM · Restricted Project
sdmitriev updated the diff for D68746: [Clang][OpenMP Offload] Move offload registration code to the wrapper.

Rebased patch and addressed review comments.

Oct 11 2019, 9:56 AM · Restricted Project
sdmitriev added inline comments to D68746: [Clang][OpenMP Offload] Move offload registration code to the wrapper.
Oct 11 2019, 8:51 AM · Restricted Project

Oct 10 2019

sdmitriev updated subscribers of D68746: [Clang][OpenMP Offload] Move offload registration code to the wrapper.
Oct 10 2019, 3:21 PM · Restricted Project
sdmitriev added inline comments to D68746: [Clang][OpenMP Offload] Move offload registration code to the wrapper.
Oct 10 2019, 3:03 PM · Restricted Project
sdmitriev added inline comments to D68746: [Clang][OpenMP Offload] Move offload registration code to the wrapper.
Oct 10 2019, 2:34 PM · Restricted Project

Oct 9 2019

sdmitriev added a comment to D68166: [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries.

Out of interest (or ignorance :) ), why is this a separate binary instead of just part of the normal clang driver? C, C++, Objective-C, and assembly all can do with a single driver, yet the offload stuff now has both clang-offload-wrapper and clang-offload-bundler. Why isn't just clang enough?

Oct 9 2019, 5:45 PM · Restricted Project
sdmitriev added inline comments to rL374219: [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries.
Oct 9 2019, 5:17 PM
sdmitriev added a comment to D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script.

I have uploaded the last part to https://reviews.llvm.org/D68746

Oct 9 2019, 5:09 PM
sdmitriev created D68746: [Clang][OpenMP Offload] Move offload registration code to the wrapper.
Oct 9 2019, 5:08 PM · Restricted Project
sdmitriev committed rGa0d83768f108: [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries (authored by sdmitriev).
[Clang][OpenMP Offload] Add new tool for wrapping offload device binaries
Oct 9 2019, 1:42 PM
sdmitriev closed D68166: [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries.
Oct 9 2019, 1:42 PM · Restricted Project
sdmitriev committed rL374219: [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries.
[Clang][OpenMP Offload] Add new tool for wrapping offload device binaries
Oct 9 2019, 1:42 PM

Oct 4 2019

sdmitriev updated the diff for D68166: [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries.

Rebased patch and changed clang-offload-wrapper CMakeLists.txt to use add_clang_tool() rather than add_clang_executable() with a custom install rule.

Oct 4 2019, 4:37 PM · Restricted Project

Oct 2 2019

sdmitriev added a comment to D68166: [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries.

I think this patch is a behaviour change. Currently, the target binary is embedded in the host binary at link time. With this change, the contents of the binary are embedded in bitcode which is subsequently fed into the link. If indeed so, that seems strictly better - code in the host that cares about the size of the bitcode now has it available at opt time, instead of at link time. The target specific nastiness objcopy would introduce is neatly sidestepped.

This change takes N binaries (that I think need to be for different triples, or the loop doesn't work) and puts them in separate section-annotated bitcode arrays. Equivalent behaviour would result from calling the tool once per binary and passing the N results onward, e.g. to llvm-link.

The functionality of 'take a binary and embed it in bitcode as a const array' is likely to be useful outside of openmp. I've done similar things in the past in non-portable fashion. Aside from the section and symbol names, I don't think there's anything specific to openmp in the tool.

How would you feel about simplifying the tool to work on one file at a time, with an interface that takes the host target (could default to whatever is running the tool) and a string for section name, which generates some bitcode containing that file as a const array plus start/end symbols derived from the section name? The change would involve deleting the multiple file handling and renaming OffloadTargets to SectionName or similar.

clang-offload-wrapper than becomes binary-to-bitcode-embedder (or better, names are hard), with the intent that projects outside of the openmp target offload compiler could use it.

edit: Or keep the multiple file handling if you prefer, preferably raising an error if there are duplicates in the requested section names

Oct 2 2019, 6:54 PM · Restricted Project
sdmitriev updated the diff for D68166: [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries.

Addressed some comments and rebased patch.

Oct 2 2019, 2:54 PM · Restricted Project
sdmitriev added inline comments to D67031: [Clang][Bundler] Error reporting improvements.
Oct 2 2019, 2:24 PM · Restricted Project
sdmitriev committed rG5ac9d18e7d9d: [Clang][Driver][NFC] Corrected DeviceActionBuilder methods' comments. (authored by sdmitriev).
[Clang][Driver][NFC] Corrected DeviceActionBuilder methods' comments.
Oct 2 2019, 1:46 PM
sdmitriev committed rL373523: [Clang][Driver][NFC] Corrected DeviceActionBuilder methods' comments..
[Clang][Driver][NFC] Corrected DeviceActionBuilder methods' comments.
Oct 2 2019, 1:45 PM
sdmitriev closed D68355: [Clang][Driver][NFC] Corrected DeviceActionBuilder methods' comments..
Oct 2 2019, 1:45 PM · Restricted Project, Restricted Project
sdmitriev added a comment to D68355: [Clang][Driver][NFC] Corrected DeviceActionBuilder methods' comments..

Mark the patch as NFC.

Oct 2 2019, 1:27 PM · Restricted Project, Restricted Project
sdmitriev created D68355: [Clang][Driver][NFC] Corrected DeviceActionBuilder methods' comments..
Oct 2 2019, 1:18 PM · Restricted Project, Restricted Project
sdmitriev added inline comments to D68166: [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries.
Oct 2 2019, 1:03 PM · Restricted Project
sdmitriev added a comment to D68166: [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries.

Ping.

Oct 2 2019, 11:29 AM · Restricted Project
sdmitriev added a comment to D67031: [Clang][Bundler] Error reporting improvements.

Ping.

Oct 2 2019, 11:29 AM · Restricted Project

Sep 27 2019

sdmitriev added a comment to D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script.

The second part was uploaded to https://reviews.llvm.org/D68166.

Sep 27 2019, 3:31 PM
sdmitriev created D68166: [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries.
Sep 27 2019, 3:31 PM · Restricted Project
sdmitriev committed rG4b343fd84c0b: [Clang][OpenMP Offload] Create start/end symbols for the offloading entry table… (authored by sdmitriev).
[Clang][OpenMP Offload] Create start/end symbols for the offloading entry table…
Sep 27 2019, 1:01 PM
sdmitriev committed rL373118: [Clang][OpenMP Offload] Create start/end symbols for the offloading entry table….
[Clang][OpenMP Offload] Create start/end symbols for the offloading entry table…
Sep 27 2019, 1:00 PM
sdmitriev closed D68070: [Clang][OpenMP Offload] Create start/end symbols for the offloading entry table with a help of a linker.
Sep 27 2019, 12:59 PM · Restricted Project

Sep 26 2019

sdmitriev abandoned D56811: [Mem2Reg] Enable promotion for bitcastable load/store values.
Sep 26 2019, 9:56 AM · Restricted Project
sdmitriev abandoned D56810: [Mem2Reg] Enable promotion for bitcastable load/store values.
Sep 26 2019, 9:56 AM · Restricted Project
sdmitriev added a comment to D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script.

I have uploaded the first part to https://reviews.llvm.org/D68070

Sep 26 2019, 9:51 AM

Sep 25 2019

sdmitriev created D68070: [Clang][OpenMP Offload] Create start/end symbols for the offloading entry table with a help of a linker.
Sep 25 2019, 8:34 PM · Restricted Project
sdmitriev abandoned D65130: [clang][OpenMP] Add clang-offload-wrapper tool.

This patch is no longer relevant since it was agreed to split https://reviews.llvm.org/D64943 into pieces in a different way.

Sep 25 2019, 4:07 PM · Restricted Project
sdmitriev updated the diff for D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script.

I have rebased patch and addressed last Alexey’s comments. If there are no more comments, I propose to split this patch into 3 pieces

Sep 25 2019, 3:32 PM
sdmitriev added a comment to D67031: [Clang][Bundler] Error reporting improvements.

Ping.

Sep 25 2019, 10:55 AM · Restricted Project

Sep 18 2019

sdmitriev added a comment to D67031: [Clang][Bundler] Error reporting improvements.

Ping.

Sep 18 2019, 11:02 AM · Restricted Project

Sep 12 2019

sdmitriev updated the diff for D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script.
  • Changed offload entry section name to “omp_offloading_entries”
  • Wrapper bit-code now uses start_ omp_offloading_entries/stop_ omp_offloading_entries symbols for accessing offload entry table assuming that these symbols are defined by the linker
  • Removed omptargetbegin.o/omptargetend.o objects
Sep 12 2019, 9:22 PM
sdmitriev added a comment to D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script.

Does this diff mix getting rid of the linker script with other changes? E.g. it looks like the metadata generation is moving from clang to the new tool, but that seems orthogonal to dropping the linker script.

Metadata is still generated by the clang, there are no changes in this area. What is moving to a wrapper tool is the generation of the offload registration code. Let me just attach the slides that I presented on the inter company meeting were the proposal was discussed. It'll probably answer most of your questions.

It does indeed, thanks. I see the motivation for delaying offload registration code. I'm pretty sure that is indeed orthogonal to removing the linker script.

How would you feel about using objcopy to embed the device binary?

Sep 12 2019, 11:00 AM
sdmitriev added a comment to D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script.

I'm on board with getting rid of the linker script. Gold's limited support for that seems conclusive.

I believe the current script does two things:
1/ takes a binary and embeds it in a section named .omp_offloading.amdgcn-amd-amdhsa
2/ provides start/end symbols for that section and for .omp_offloading.entries.

2/ is discussed above.
1/ can be implemented as a call to (llvm-)objcopy

If binary is used as the value for --input-target, the input file will be embedded as a data section in an ELF relocatable object, with symbols _binary_<file_name>_start, _binary_<file_name>_end, and _binary_<file_name>_size representing the start, end and size of the data, where <file_name> is the path of the input file as specified on the command line with non-alphanumeric characters converted to _.

I think dropping the linker script means that cmake will need to invoke an extra executable. As far as I can see, that tool can be objcopy instead of clang-offload-wrapper.

Does this diff mix getting rid of the linker script with other changes? E.g. it looks like the metadata generation is moving from clang to the new tool, but that seems orthogonal to dropping the linker script.

Sep 12 2019, 9:14 AM

Sep 11 2019

sdmitriev added a comment to D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script.

I'm not sure copying the crtbegin/crtend mechanism from the early days of C runtime is ideal. Since the data is stored in a common section anyway, please could we rename it to __omp_offloading_entries in which case the linker will provide start/end symbols automatically?

Well, I never said that it is an ideal solution, but it is a known mechanism that works well in many cases and can also be reused for the offloading entry table.
I do not fully understand your suggestion for renaming entries section, how it will help with providing start/end symbols for the entries. Can you please provide more details?

Given a custom elf section with a C identifier as a name, the linker will provide definitions of __start_name/__stop_name to satisfy unresolved symbols. I don't believe this occurs if the section name is not a C identifier, e.g. contains a period. So unless I've misinterpreted the purpose of the two object files, they can be removed in exchange for renaming the section.

Sep 11 2019, 6:42 PM
sdmitriev added a comment to D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script.

I'm not sure copying the crtbegin/crtend mechanism from the early days of C runtime is ideal. Since the data is stored in a common section anyway, please could we rename it to __omp_offloading_entries in which case the linker will provide start/end symbols automatically?

Sep 11 2019, 1:27 PM
sdmitriev added a comment to D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script.

OpenMP linker script is known to cause problems for gold and lld linkers on Linux and it will also cause problems for Windows enabling in future

What are the known problems with the linker script? I'm wondering if they can be resolved without the overhead of introducing a new tool.

They just do not support linker script. And, thus, cannot be used for offloading. Only ld supports it.

In what respect? I've used linker scripts with both gold and lld, and both instances of --help text claim to support them. In the case of lld, a very complicated script hit a few internal errors, but I believe they've all been fixed since.

Hmm, I tried it with gold some time ago and it just did not work for me. The linking failed with diagnostics that some of the commands in the script are unknown.

The problem turns out to be the 'insert before' statement. ld and lld support it, gold does not. According to https://bugzilla.redhat.com/show_bug.cgi?id=927573, the recommended workaround is essentially that implemented in this differential. See also https://sourceware.org/bugzilla/show_bug.cgi?id=15373.

Sep 11 2019, 1:05 PM
sdmitriev updated the diff for D65130: [clang][OpenMP] Add clang-offload-wrapper tool.

Rebase

Sep 11 2019, 11:44 AM · Restricted Project
sdmitriev updated the diff for D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script.

Rebase

Sep 11 2019, 11:24 AM
sdmitriev updated the diff for D67031: [Clang][Bundler] Error reporting improvements.

Rebase

Sep 11 2019, 10:30 AM · Restricted Project
sdmitriev committed rGe39b5710c925: [Clang][Bundler] Replace std::vector by SmallVector [NFC] (authored by sdmitriev).
[Clang][Bundler] Replace std::vector by SmallVector [NFC]
Sep 11 2019, 9:33 AM
sdmitriev committed rL371637: [Clang][Bundler] Replace std::vector by SmallVector [NFC].
[Clang][Bundler] Replace std::vector by SmallVector [NFC]
Sep 11 2019, 9:28 AM
sdmitriev closed D67413: [Clang][Bundler] Replace std::vector by SmallVector [NFC].
Sep 11 2019, 9:28 AM · Restricted Project