Page MenuHomePhabricator

vzakhari (Vyacheslav Zakharin)
User

Projects

User does not belong to any projects.

User Details

User Since
May 29 2018, 3:20 PM (214 w, 5 m)

Recent Activity

Today

vzakhari accepted D129020: [flang] Cope with overflow in real MOD/MODULO.

Sorry for the delay. LGTM.

Tue, Jul 5, 1:28 PM · Restricted Project, Restricted Project

Tue, Jun 28

vzakhari committed rG9f35657983c5: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls. (authored by vzakhari).
[flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls.
Tue, Jun 28, 1:38 PM · Restricted Project, Restricted Project
vzakhari closed D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..
Tue, Jun 28, 1:38 PM · Restricted Project, Restricted Project, Restricted Project
vzakhari added inline comments to D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..
Tue, Jun 28, 1:25 PM · Restricted Project, Restricted Project, Restricted Project
vzakhari retitled D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls. from Lower Fortran math intrinsic operations into MLIR ops or libm calls. to [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..
Tue, Jun 28, 1:25 PM · Restricted Project, Restricted Project, Restricted Project
vzakhari updated the diff for D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..
Tue, Jun 28, 10:40 AM · Restricted Project, Restricted Project, Restricted Project
vzakhari added a comment to D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..

Thank you all for the reviews! I will upload the final changes shortly and merge them after pre-merge checks pass.

Tue, Jun 28, 10:40 AM · Restricted Project, Restricted Project, Restricted Project
vzakhari updated the diff for D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..

Latest revision is rebase + Lower/array-expression-slice-1.f90 fix.

Tue, Jun 28, 9:11 AM · Restricted Project, Restricted Project, Restricted Project

Mon, Jun 27

vzakhari updated the diff for D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..
Mon, Jun 27, 5:05 PM · Restricted Project, Restricted Project, Restricted Project
vzakhari added a comment to D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..

@awarzynski, thank you for the review!

Mon, Jun 27, 4:57 PM · Restricted Project, Restricted Project, Restricted Project

Fri, Jun 24

vzakhari updated the diff for D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..
Fri, Jun 24, 12:43 PM · Restricted Project, Restricted Project, Restricted Project
vzakhari added a comment to D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..

It would be nice if you could lower most of the Fortran math intrinsics to the Math dialect. You can extend it as needed. LLVM backends can then decide whether they need libcalls.

It should give you some optimisation opportunities in MLIR.

Fri, Jun 24, 12:38 PM · Restricted Project, Restricted Project, Restricted Project
vzakhari added a comment to D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..

Thank you for the thorough review! Please see my comments below.

Fri, Jun 24, 12:25 PM · Restricted Project, Restricted Project, Restricted Project

Thu, Jun 23

vzakhari updated the diff for D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..
Thu, Jun 23, 2:09 PM · Restricted Project, Restricted Project, Restricted Project
vzakhari added a comment to D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..

Thank you for reviewing!

Thu, Jun 23, 1:39 PM · Restricted Project, Restricted Project, Restricted Project
vzakhari committed rGb163ac33bdfc: [mlir][math] Lower atan to libm (authored by vzakhari).
[mlir][math] Lower atan to libm
Thu, Jun 23, 10:57 AM · Restricted Project, Restricted Project
vzakhari closed D128454: [mlir][math] Lower atan to libm.
Thu, Jun 23, 10:57 AM · Restricted Project, Restricted Project
vzakhari added a comment to D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..

+1. Yes, that would be a fast way to get that portion of the patch in.

Thu, Jun 23, 10:43 AM · Restricted Project, Restricted Project, Restricted Project
vzakhari updated the diff for D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..
Thu, Jun 23, 10:26 AM · Restricted Project, Restricted Project, Restricted Project
vzakhari requested review of D128454: [mlir][math] Lower atan to libm.
Thu, Jun 23, 10:16 AM · Restricted Project, Restricted Project

Wed, Jun 22

vzakhari added a comment to D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..

Please review.

Wed, Jun 22, 2:58 PM · Restricted Project, Restricted Project, Restricted Project
vzakhari requested review of D128385: [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls..
Wed, Jun 22, 2:57 PM · Restricted Project, Restricted Project, Restricted Project

Nov 8 2021

vzakhari committed rG1b409df6131b: [NFC] Initial documentation for declare target indirect support. (authored by vzakhari).
[NFC] Initial documentation for declare target indirect support.
Nov 8 2021, 3:16 PM
vzakhari closed D110193: [RFC] Initial documentation for declare target indirect support..
Nov 8 2021, 3:16 PM · Restricted Project

Oct 20 2021

vzakhari added a comment to D110193: [RFC] Initial documentation for declare target indirect support..

If there are no more comments, I am going to merge this by the end of the week.

Oct 20 2021, 5:02 PM · Restricted Project

Oct 19 2021

vzakhari retitled D112103: [WIP][RFC] Sample code for containerizing offload images into one ELF. from [WIP] Sample code for containerizing offload images into one ELF. to [WIP][RFC] Sample code for containerizing offload images into one ELF..
Oct 19 2021, 4:01 PM · Restricted Project
vzakhari requested review of D112103: [WIP][RFC] Sample code for containerizing offload images into one ELF..
Oct 19 2021, 4:01 PM · Restricted Project

Oct 6 2021

vzakhari added a reviewer for D110193: [RFC] Initial documentation for declare target indirect support.: JonChesterfield.
Oct 6 2021, 8:59 AM · Restricted Project

Oct 5 2021

vzakhari added inline comments to D110193: [RFC] Initial documentation for declare target indirect support..
Oct 5 2021, 10:18 AM · Restricted Project

Sep 30 2021

vzakhari added a reviewer for D110193: [RFC] Initial documentation for declare target indirect support.: dreachem.
Sep 30 2021, 9:41 PM · Restricted Project

Sep 22 2021

vzakhari updated the diff for D110193: [RFC] Initial documentation for declare target indirect support..
Sep 22 2021, 2:25 PM · Restricted Project
vzakhari added inline comments to D110193: [RFC] Initial documentation for declare target indirect support..
Sep 22 2021, 10:13 AM · Restricted Project

Sep 21 2021

vzakhari added inline comments to D110193: [RFC] Initial documentation for declare target indirect support..
Sep 21 2021, 7:03 PM · Restricted Project
vzakhari added inline comments to D110193: [RFC] Initial documentation for declare target indirect support..
Sep 21 2021, 12:36 PM · Restricted Project
vzakhari requested review of D110193: [RFC] Initial documentation for declare target indirect support..
Sep 21 2021, 12:25 PM · Restricted Project

Aug 25 2021

vzakhari committed rG2e192ab1f457: [CodeExtractor] Preserve topological order for the return blocks. (authored by vzakhari).
[CodeExtractor] Preserve topological order for the return blocks.
Aug 25 2021, 8:09 AM
vzakhari closed D108673: [CodeExtractor] Preserve topological order for the return blocks..
Aug 25 2021, 8:09 AM · Restricted Project, Restricted Project

Aug 24 2021

vzakhari updated the diff for D108673: [CodeExtractor] Preserve topological order for the return blocks..
Aug 24 2021, 6:48 PM · Restricted Project, Restricted Project
vzakhari requested review of D108673: [CodeExtractor] Preserve topological order for the return blocks..
Aug 24 2021, 4:25 PM · Restricted Project, Restricted Project
vzakhari added inline comments to D87302: [IRSim][IROutliner] Adding DebugInfo handling for IR outlined functions..
Aug 24 2021, 4:17 PM · debug-info, Restricted Project

Aug 18 2021

vzakhari committed rG1ffbe8c04ff2: [clang-offload-wrapper] Disabled ELF offload notes embedding by default. (authored by vzakhari).
[clang-offload-wrapper] Disabled ELF offload notes embedding by default.
Aug 18 2021, 8:19 AM
vzakhari closed D108246: [clang-offload-wrapper] Disabled ELF offload notes embedding by default..
Aug 18 2021, 8:19 AM · Restricted Project, Restricted Project
vzakhari added a comment to D108303: [clang][openmp] Disable embedded elf notes.

I like D108246 more. None of the offloading tests updated in D108246 failed with the above patch, perhaps they're not run by make check-openmp

Aug 18 2021, 8:14 AM · Restricted Project
vzakhari added a comment to D108303: [clang][openmp] Disable embedded elf notes.

Hi Jon, I am about to merge D108246 that disables the notes embedding.

Aug 18 2021, 8:08 AM · Restricted Project
vzakhari added a comment to D99551: [clang-offload-wrapper] Add standard notes for ELF offload images.

Nvptx broken here too, amdgpu is fine. I'm guessing one of the cuda tools does some overly aggressive input validation that we're running afoul of.

There was a discussion about this on the call today - plan was to put it behind a disabled boolean argument while fixing to avoid downstream churn. Sadly the original patch was not authored with that in mind. I suggest if we can't get that patch together asap we revert this and fix it offline (even if the fix is adding said flag)

Aug 18 2021, 8:07 AM · Restricted Project, Restricted Project, Restricted Project

Aug 17 2021

vzakhari updated the diff for D108246: [clang-offload-wrapper] Disabled ELF offload notes embedding by default..
Aug 17 2021, 4:29 PM · Restricted Project, Restricted Project
vzakhari added a comment to D108246: [clang-offload-wrapper] Disabled ELF offload notes embedding by default..

I would prefer to revert 93d08acaacec951dbb302f77eeae51974985b6b2 now and then fix the CUDA toolchain rather than making it someone else's problem.

Aug 17 2021, 3:00 PM · Restricted Project, Restricted Project
vzakhari requested review of D108246: [clang-offload-wrapper] Disabled ELF offload notes embedding by default..
Aug 17 2021, 2:50 PM · Restricted Project, Restricted Project
vzakhari added a comment to D99551: [clang-offload-wrapper] Add standard notes for ELF offload images.

@jhuber6, thank you for reporting this. I do not have a properly setup CUDA system currently. Can you please invoke clang-offload-wrapper with -save-temps and send the temporary files to me?

I sent it to you, any luck or should we revert this upstream for the time being.

Unfortunately, I did not receive it. Can you please check if the mail was blocked on your side? Can you please try to archive it with a password and send it again?
I would like to prepare a patch to put this functionality under a switch that is off by default. I think we want to have this working eventually (and it actually works with x86_64 offload), so it will be easier to just flip a switch, when I figure out what CUDA API does not like about the modified ELF image. Does it sound appropriate to you?

I put it in a .tar.gz file, I think your domain is blocking it. Anything else I can use?

Aug 17 2021, 2:24 PM · Restricted Project, Restricted Project, Restricted Project
vzakhari added a comment to D99551: [clang-offload-wrapper] Add standard notes for ELF offload images.

@jhuber6, thank you for reporting this. I do not have a properly setup CUDA system currently. Can you please invoke clang-offload-wrapper with -save-temps and send the temporary files to me?

I sent it to you, any luck or should we revert this upstream for the time being.

Aug 17 2021, 2:18 PM · Restricted Project, Restricted Project, Restricted Project
vzakhari added a comment to D99551: [clang-offload-wrapper] Add standard notes for ELF offload images.

@jhuber6, thank you for reporting this. I do not have a properly setup CUDA system currently. Can you please invoke clang-offload-wrapper with -save-temps and send the temporary files to me?

Aug 17 2021, 12:48 PM · Restricted Project, Restricted Project, Restricted Project

Aug 16 2021

vzakhari added a comment to D99553: [libomptarget] Read standard notes for ELF offload images.

In the latest update I added llvm-objcopy as a dependence for clang-offload-wrapper, because otherwise make check-libomptarget would fail.

Aug 16 2021, 9:51 PM · Restricted Project
vzakhari updated the diff for D99553: [libomptarget] Read standard notes for ELF offload images.
Aug 16 2021, 9:47 PM · Restricted Project
vzakhari committed rG93d08acaacec: [clang-offload-wrapper] Add standard notes for ELF offload images (authored by vzakhari).
[clang-offload-wrapper] Add standard notes for ELF offload images
Aug 16 2021, 1:20 PM
vzakhari closed D99551: [clang-offload-wrapper] Add standard notes for ELF offload images.
Aug 16 2021, 1:20 PM · Restricted Project, Restricted Project, Restricted Project

Aug 12 2021

vzakhari committed rG15497e62f64d: [openmp][ELF] Recognize LLVM OpenMP offload specific notes (authored by vzakhari).
[openmp][ELF] Recognize LLVM OpenMP offload specific notes
Aug 12 2021, 1:52 PM
vzakhari closed D99552: [openmp][ELF] Recognize LLVM OpenMP offload specific notes.
Aug 12 2021, 1:52 PM · Restricted Project
vzakhari committed rG50c7e299f153: [NFC] Enumerate LLVMOMPOFFLOAD note types. (authored by vzakhari).
[NFC] Enumerate LLVMOMPOFFLOAD note types.
Aug 12 2021, 11:07 AM
vzakhari closed D99612: [NFC] Enumerate LLVMOMPOFFLOAD note types..
Aug 12 2021, 11:07 AM · Restricted Project, Restricted Project

Aug 10 2021

vzakhari added a comment to D99553: [libomptarget] Read standard notes for ELF offload images.

The commit message is out of date.

The implementation is very clear. Thank you for the ping, missed the patch update email.

Edit: appears I had some inline comments from a previous revision that I had not posted, please disregard them.

Aug 10 2021, 11:15 AM · Restricted Project

Aug 9 2021

vzakhari added a comment to D99553: [libomptarget] Read standard notes for ELF offload images.

ping...
Can someone please review the updated (simplified) patch?

Aug 9 2021, 12:05 PM · Restricted Project

Aug 4 2021

vzakhari updated the diff for D99553: [libomptarget] Read standard notes for ELF offload images.
Aug 4 2021, 11:12 AM · Restricted Project
vzakhari updated the diff for D99551: [clang-offload-wrapper] Add standard notes for ELF offload images.
Aug 4 2021, 11:10 AM · Restricted Project, Restricted Project, Restricted Project

Jul 6 2021

vzakhari accepted D105375: [OPENMP]Remove const firstprivate allocation as a variable in a constant space..

LGTM

Jul 6 2021, 3:07 PM · Restricted Project

Jun 21 2021

vzakhari committed rGaad9e48c5fc7: [NFC][libomptarget] Remove redundant libelf dependency for elf_common. (authored by vzakhari).
[NFC][libomptarget] Remove redundant libelf dependency for elf_common.
Jun 21 2021, 7:21 AM
vzakhari closed D104549: [NFC][libomptarget] Remove redundant libelf dependency for elf_common..
Jun 21 2021, 7:21 AM · Restricted Project

Jun 18 2021

vzakhari requested review of D104549: [NFC][libomptarget] Remove redundant libelf dependency for elf_common..
Jun 18 2021, 9:48 AM · Restricted Project
vzakhari committed rG836992ab9a42: [NFC][libomptarget] Build elf_common with PIC. (authored by vzakhari).
[NFC][libomptarget] Build elf_common with PIC.
Jun 18 2021, 9:21 AM
vzakhari committed rGc5b7c7c8f7fc: [NFC][libomptarget] Fixed -DLLVM_ENABLE_RUNTIMES="openmp" build. (authored by vzakhari).
[NFC][libomptarget] Fixed -DLLVM_ENABLE_RUNTIMES="openmp" build.
Jun 18 2021, 9:21 AM
vzakhari closed D104545: [NFC][libomptarget] Build elf_common with PIC..
Jun 18 2021, 9:21 AM · Restricted Project
vzakhari closed D104535: [NFC][libomptarget] Fixed -DLLVM_ENABLE_RUNTIMES="openmp" build..
Jun 18 2021, 9:21 AM · Restricted Project
vzakhari added a reviewer for D104545: [NFC][libomptarget] Build elf_common with PIC.: JonChesterfield.
Jun 18 2021, 9:03 AM · Restricted Project
vzakhari added a comment to D103545: [NFC][libomptarget] Reduce the dependency on libelf.

I build my LLVM with the command:

cmake -G Ninja -DCMAKE_INSTALL_PREFIX=$HOME/Documents/deploy/llvm/release -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_INSTALL_UTILS=ON -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_TESTS=ON -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_ENABLE_ASSERTIONS=ON $HOME/Documents/vscode/llvm-project/llvm

And then have a separate configure for OpenMP:

cmake -G Ninja -DCMAKE_INSTALL_PREFIX=$HOME/Documents/deploy/openmp/debug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=$HOME/Documents/deploy/llvm/release/bin/clang -DCMAKE_CXX_COMPILER=$HOME/Documents/deploy/llvm/release/bin/clang++ -DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=75 -DOPENMP_NOT_EXECUTABLE=$HOME/Documents/deploy/llvm/release/bin/not -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda -DLLVM_ROOT=$HOME/Documents/deploy/llvm/release -DLIBOMPTARGET_LLVM_INCLUDE_DIRS=$HOME/Documents/vscode/llvm-project/llvm/include $HOME/Documents/vscode/llvm-project/openm
Jun 18 2021, 9:02 AM · Restricted Project
vzakhari requested review of D104545: [NFC][libomptarget] Build elf_common with PIC..
Jun 18 2021, 9:01 AM · Restricted Project
vzakhari added a comment to D103545: [NFC][libomptarget] Reduce the dependency on libelf.

Thank you, @ronlieb! I am able to reproduce it. It seems that LLVM_ENABLE_RUNTIMES behavior is quite different from the -DLLVM_ENABLE_PROJECTS="openmp" that I use (so I did not see this issue before). It seems to me that in LLVM_ENABLE_RUNTIMES mode, openmp is configured/built as a standalone project using clang built by the "main" cmake/build step, but for some reason OPENMP_STANDALONE_BUILD is false. I am not sure about the right solution yet. Can you please add openmp to your -DLLVM_ENABLE_PROJECTS="clang;lld" and remove "-DLLVM_ENABLE_RUNTIMES="openmp" as a temporary workaround?

i added openmp to PROJECTS, and removed -DLLVM_ENABLE_RUNTIMES="openmp"

results in error

CMake Error at cmake/modules/LLVMExternalProjectUtils.cmake:358 (add_custom_target):

add_custom_target cannot create target "check-openmp" because another
target with the same name already exists.  The existing target is a custom
target created in source directory
"/work/rlieberm/mono-repo/llvm-project/openmp".  See documentation for
policy CMP0002 for more details.

Call Stack (most recent call first):

runtimes/CMakeLists.txt:226 (llvm_ExternalProject_Add)
runtimes/CMakeLists.txt:353 (runtime_default_target)
Jun 18 2021, 8:59 AM · Restricted Project
vzakhari added a comment to D103545: [NFC][libomptarget] Reduce the dependency on libelf.

i forgot to mention that the first problem i encountered with this patch is that elf_common.cpp has difficulties finding its LLVM header files.
i am reporting that issue. For me, the fPIC relocatables might be a downstream issue, still looking into that one.

for the header file issue, i cobbled this up
add to end of file openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt
include_directories(${LIBOMPTARGET_LLVM_INCLUDE_DIRS})

and added a cmake definition kind of like:
-DLIBOMPTARGET_LLVM_INCLUDE_DIRS=/<blah>/llvm-project/llvm/include

A person more versed in CMake might have a better solution, hope so.

Jun 18 2021, 7:27 AM · Restricted Project
vzakhari added a reviewer for D104535: [NFC][libomptarget] Fixed -DLLVM_ENABLE_RUNTIMES="openmp" build.: ronlieb.
Jun 18 2021, 7:25 AM · Restricted Project
vzakhari requested review of D104535: [NFC][libomptarget] Fixed -DLLVM_ENABLE_RUNTIMES="openmp" build..
Jun 18 2021, 7:24 AM · Restricted Project
vzakhari added a comment to D103545: [NFC][libomptarget] Reduce the dependency on libelf.

[AMD Official Use Only]

Trunk as of this morning
work/rlieberm/mono-repo/llvm-project/openmp/libomptarget/plugins/common/elf_common/elf_common.cpp
/work/rlieberm/mono-repo/llvm-project/openmp/libomptarget/plugins/common/elf_common/elf_common.cpp:15:10: fatal error: 'llvm/BinaryFormat/Magic.h' file not found
#include "llvm/BinaryFormat/Magic.h"

^~~~~~~~~~~~~~~~~~~~~~~~~~~

1 error generated.
[182/204] Building CXX object openmp/tools/archer/CMakeFiles/archer.dir/ompt-tsan.cpp.o

Cmake command, you can probably drop the CMAKE_INSTALL_PREFIX

cmake -DCMAKE_INSTALL_PREFIX=/home/rlieberm/rocm/trunk_1.0 \

-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS="clang;lld" \
-DLLVM_TARGETS_TO_BUILD="X86;AMDGPU" \
-DLLVM_ENABLE_ASSERTIONS=ON                        \
-DLLVM_ENABLE_RUNTIMES="openmp" \
-DCLANG_DEFAULT_LINKER=lld                         \
../llvm -GNinja
Jun 18 2021, 7:05 AM · Restricted Project

Jun 17 2021

vzakhari added a comment to D103545: [NFC][libomptarget] Reduce the dependency on libelf.

Can you please provide the CMake command to reproduce this? I cannot reproduce this with an ordinary in-tree build.

Jun 17 2021, 9:14 PM · Restricted Project

Jun 16 2021

vzakhari committed rGb5c4fc0f232b: [NFC][libomptarget] Reduce the dependency on libelf (authored by vzakhari).
[NFC][libomptarget] Reduce the dependency on libelf
Jun 16 2021, 8:35 AM
vzakhari closed D103545: [NFC][libomptarget] Reduce the dependency on libelf.
Jun 16 2021, 8:34 AM · Restricted Project
vzakhari added a comment to D103545: [NFC][libomptarget] Reduce the dependency on libelf.

Are you expecting to land this soon?

Jun 16 2021, 3:27 AM · Restricted Project

Jun 15 2021

vzakhari updated the diff for D103545: [NFC][libomptarget] Reduce the dependency on libelf.

Just a rebase.

Jun 15 2021, 10:37 PM · Restricted Project

Jun 7 2021

vzakhari abandoned D103546: Added ELFObjectFileBase::checkMagic() for checking ELF magic word..

Implemented using lib/BinaryFormat/Magic.cpp

Jun 7 2021, 3:37 PM · Restricted Project
vzakhari updated the diff for D103545: [NFC][libomptarget] Reduce the dependency on libelf.
Jun 7 2021, 3:35 PM · Restricted Project
vzakhari updated the diff for D103545: [NFC][libomptarget] Reduce the dependency on libelf.
Jun 7 2021, 1:58 PM · Restricted Project
vzakhari added a comment to D103546: Added ELFObjectFileBase::checkMagic() for checking ELF magic word..

We have lib/BinaryFormat/Magic.cpp. Do we need the ELF specific API?

Thanks! I was not aware of this code. How about adding something like static inline is_any_elf(file_magic) method in Magic.h? If you agree, then I will abandon this change-set and add the new method in D103545.

I'm assuming this would be to avoid having to write something like if (objectType == elf || objectType == elf_relocatable || /*all the other elf_* types*/ ...) (or an equivalent switch statement)? Is this something you'd use in more than one place within your code?

Jun 7 2021, 8:47 AM · Restricted Project

Jun 4 2021

vzakhari added a comment to D103546: Added ELFObjectFileBase::checkMagic() for checking ELF magic word..

We have lib/BinaryFormat/Magic.cpp. Do we need the ELF specific API?

Jun 4 2021, 11:40 AM · Restricted Project
vzakhari updated the diff for D103545: [NFC][libomptarget] Reduce the dependency on libelf.
Jun 4 2021, 11:09 AM · Restricted Project
vzakhari added inline comments to D103545: [NFC][libomptarget] Reduce the dependency on libelf.
Jun 4 2021, 11:09 AM · Restricted Project
vzakhari updated the diff for D103546: Added ELFObjectFileBase::checkMagic() for checking ELF magic word..
Jun 4 2021, 11:08 AM · Restricted Project

Jun 3 2021

vzakhari added a reviewer for D103545: [NFC][libomptarget] Reduce the dependency on libelf: JonChesterfield.
Jun 3 2021, 1:13 PM · Restricted Project

Jun 2 2021

vzakhari added a comment to D101341: Initialize optional members of ELFYAML types..

@vzakhari, what's the motivation for doing this? These data structures are used within yaml2obj/obj2yaml, although I'm not particularly familiar with the plumbing to identify whether it matters. My suspicion is that it doesn't.

@jhenderson, there are two ways to create a YAML file using YAML mappings. The first one is to create a YAML file from a string bufffer (see line 38 in llvm/unittests/ObjectYAML/ELFYAMLTest.cpp). The second way is to populate the ELFYAML:: data structures and stream them into yaml::Output. Both ways are valid. The second way is a little bit more convenient for programmatic ELF-YAML creation in my downstream application. When I try to use ELFYAML:: data structures, there is no convenient way to make sure that all optional members in them are initialized. Neither default nor zero-initialization works. This is why I made these changes to make sure that all optional members are initialized properly. Note that the default values are not necessarily zeroes.

Which cases don't have zero as their default value? The ones you've modified in this patch all are (even the Mips enums are - the enum values are value 0).

Sorry, I do not see where I said that there are no default values. I said that neither default nor zero-initialization works - in this phrase I referred to initialization of POD members of objects, when we use default or zero-initialization. For example, look at struct MipsABIFlags: if we declare an object of this type using default initialization/construction, then members like ISARevision will be default constructed, which in turn causes their value to be undefined (because they use the default constructor of the type defined by LLVM_YAML_STRONG_TYPEDEF). Value/zero-initialization will also not work for such objects, because struct MipsABIFlags has a user-defined constructor.

Jun 2 2021, 12:41 PM · Restricted Project, Restricted Project
vzakhari added reviewers for D103546: Added ELFObjectFileBase::checkMagic() for checking ELF magic word.: MaskRay, jhenderson.
Jun 2 2021, 12:19 PM · Restricted Project
vzakhari requested review of D103546: Added ELFObjectFileBase::checkMagic() for checking ELF magic word..
Jun 2 2021, 11:43 AM · Restricted Project
vzakhari requested review of D103545: [NFC][libomptarget] Reduce the dependency on libelf.
Jun 2 2021, 11:41 AM · Restricted Project

May 25 2021

vzakhari added a comment to D101341: Initialize optional members of ELFYAML types..

ping

May 25 2021, 9:47 AM · Restricted Project, Restricted Project

May 20 2021

vzakhari added inline comments to D101509: An attempt to abandon omptarget out-of-tree builds..
May 20 2021, 4:06 PM · Restricted Project

May 17 2021

vzakhari added inline comments to D101509: An attempt to abandon omptarget out-of-tree builds..
May 17 2021, 1:19 PM · Restricted Project