[PATCH] D126904: [llvm-objdump] Add support for dumping embedded offloading data
Joseph Huber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 2 11:39:52 PDT 2022
jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992, MaskRay, yaxunl, tra, saiislam.
Herald added subscribers: jsji, StephenFan, pengfei, rupprecht, mgorny.
Herald added a reviewer: alexander-shaposhnikov.
Herald added a reviewer: jhenderson.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added subscribers: llvm-commits, sstefan1.
Herald added a project: LLVM.
In Clang/LLVM we are moving towards a new binary format to store many
embedded object files to create a fatbinary. This patch adds support for
dumping these embedded images in the `llvm-objdump` tool. This will
allow users to query information about what is stored inside the binary.
This has very similar functionality to the `cuobjdump` tool for thoe familiar
with the Nvidia utilities. The proposed use is as follows:
$ clang input.c -fopenmp --offload-arch=sm_70 --offload-arch=sm_52 -c
$ llvm-objdump -O input.o
input.o: file format elf64-x86-64
OFFLOADIND IMAGE [0]:
kind cubin
arch sm_52
triple nvptx64-nvidia-cuda
producer openmp
OFFLOADIND IMAGE [1]:
kind cubin
arch sm_70
triple nvptx64-nvidia-cuda
producer openmp
This will be expanded further once we start embedding more information
into these offloading images. Right now we are planning on adding
flags and entries for debug level, optimization, LTO usage, target
features, among others.
This patch only supports printing these sections, later we will want to
support dumping files the user may be interested in via another flag. I
am unsure if this should go here in `llvm-objdump` or `llvm-objcopy`.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D126904
Files:
llvm/test/tools/llvm-objdump/Offload/Inputs/offload-binary.out
llvm/test/tools/llvm-objdump/Offload/Inputs/offload-elf.o
llvm/test/tools/llvm-objdump/Offload/offload.test
llvm/tools/llvm-objdump/CMakeLists.txt
llvm/tools/llvm-objdump/ObjdumpOpts.td
llvm/tools/llvm-objdump/OffloadDump.cpp
llvm/tools/llvm-objdump/OffloadDump.h
llvm/tools/llvm-objdump/llvm-objdump.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126904.433814.patch
Type: text/x-patch
Size: 18494 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220602/1422058f/attachment.bin>
More information about the llvm-commits
mailing list