This is an archive of the discontinued LLVM Phabricator instance.

LLD/ELF/AMDGPU: Process AMDGPU-specific e_flags
ClosedPublic

Authored by kzhuravl on Oct 20 2017, 1:20 PM.

Diff Detail

Event Timeline

kzhuravl created this revision.Oct 20 2017, 1:20 PM
t-tye added inline comments.Oct 20 2017, 7:54 PM
ELF/Arch/AMDGPU.cpp
47

Is it worth avoiding checking the first element since it has already been inspected. For example:

for (const auto &F : ArrayRef(ObjectFiles).slice(1)) {
ruiu added inline comments.Oct 22 2017, 7:10 PM
ELF/Arch/AMDGPU.cpp
47

Please add a comment saying that this loop is to verify that all input files have the same e_flags.

const auto -> InputFile * as we do not use auto unless its type is apparent.

FirstEFlags -> Ret because we usually prefer short variable names.

48

Can you just remove this temporary variable and directly use the value?

kzhuravl updated this revision to Diff 120096.Oct 24 2017, 10:28 AM
kzhuravl marked 3 inline comments as done.

Address review feedback.

ruiu edited edge metadata.Oct 24 2017, 10:31 AM

How did you create Inputs/amdgpu-kernel-2.o? We generally want to avoid checking in binary files, so if it is created by llvm-mc or something, we'd like to check in the source file instead of the binary file.

In D39140#905422, @ruiu wrote:

How did you create Inputs/amdgpu-kernel-2.o? We generally want to avoid checking in binary files, so if it is created by llvm-mc or something, we'd like to check in the source file instead of the binary file.

It was created using "llc -filetype=obj...". Unfortunately we do not have an assembler for that architecture so cannot use llvm-mc.

We are also working on more changes to e_flags (related to architectures). Once we agree on those and add support to llvm, I was planning to replace this binary file with the source file (few weeks away). Would that be ok?

ruiu accepted this revision.Oct 24 2017, 10:58 AM

Yes, when you complete your other changes, please replace the file. LGTM

ELF/Arch/AMDGPU.cpp
51

toString(F) is better than F->getName() because an archive file name is included in the former output if F was pulled out from an archive.

This revision is now accepted and ready to land.Oct 24 2017, 10:58 AM
This revision was automatically updated to reflect the committed changes.
kzhuravl marked an inline comment as done.