Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
(#143845)" (#151094)
This fixes the issues with 0b054e2
This reverts commit b80ce054206db223ec8c3cd55fad510c97afbc9f.
|
|
These changes allow LLVM and Clang to be built with Clang targeting
Arm64EC using the MSVC linker.
Built with these options:
```
-DLLVM_ENABLE_PROJECTS="clang"
-DLLVM_HOST_TRIPLE=arm64ec-pc-windows-msvc
-DCMAKE_C_COMPILER=clang-cl.exe
-DCMAKE_C_COMPILER_TARGET=arm64ec-pc-windows-msvc
-DCMAKE_CXX_COMPILER=clang-cl.exe
-DCMAKE_CXX_COMPILER_TARGET=arm64ec-pc-windows-msvc
-DCMAKE_LINKER_TYPE=MSVC
```
|
|
Add support for measuring decode times in llvm-mc tool. Add command line
options to enable time-trace profiling (similar to llc or opt) and add
option `runs` to run the decoder several times on each instruction.
|
|
Also known as Function Description Entries. The entries occupy a
contiguous piece of the section, so the code is mostly straight-forward.
For more information about the SFrame unwind format, see the
[specification](https://sourceware.org/binutils/wiki/sframe) and the
related [RFC](https://discourse.llvm.org/t/rfc-adding-sframe-support-to-llvm/86900).
|
|
- Added `IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT_STRICT_MODE`
- Added
`IMAGE_DLL_CHARACTERISTICS_EX_CET_SET_CONTEXT_IP_VALIDATION_RELAXED_MODE`
- Added
`IMAGE_DLL_CHARACTERISTICS_EX_CET_DYNAMIC_APIS_ALLOW_IN_PROC_ONLY`
- Added `IMAGE_DLL_CHARACTERISTICS_EX_CET_RESERVED_1`
- Added `IMAGE_DLL_CHARACTERISTICS_EX_CET_RESERVED_2`
- Added `IMAGE_DLL_CHARACTERISTICS_EX_FORWARD_CFI_COMPAT`
- Added `IMAGE_DLL_CHARACTERISTICS_EX_HOTPATCH_COMPATIBLE`
|
|
(#149214)
Add entity mapping mode to llvm-ir2vec and improve triplet generation format for knowledge graph embedding training.
This change streamlines the workflow for training the vocabulary embeddings with IR2Vec by:
1. Directly generating numeric IDs instead of requiring string-to-ID preprocessing
2. Providing entity mappings in standard knowledge graph embedding format
3. Structuring triplet output in train2id format compatible with knowledge graph embedding frameworks
4. Adding metadata headers to simplify post-processing and training setup
These improvements make IR2Vec more compatible with standard knowledge graph embedding training pipelines and reduce the preprocessing steps needed before training.
See #149215 for more details on how it is used.
(Tracking issues - #141817, #141834)
|
|
Cygwin and MinGW share the auto import behavior that could result in
__stack_check_guard being non-dso-local. Allow windres to assume a
Cygwin target as well as a MinGW one, so defines like _WIN32 would not
be present on Cygwin.
|
|
getObjFileLowering() already returns TargetLoweringObjectFile *.
|
|
(#145687)
This relands PRs #143108 and #144538.
The original PR was reverted due to a mistake that made all the mlir
tests run only if SPIRV target was enabled. This is now resolved since
enabling spirv-tools does not required SPIRV target any longer.
spirv-tools are not required by default to run SPIRV mlir tests, but
they can be optionally enabled in some SPIRV mlir test to verify that
the produced SPIRV assembly pass validation.
The other reverted PR #144685 is not longer needed and not part of this
relanding.
Original commit message:
> At the MLIR level unsigned integer and signless integers are different
types. Indeed when looking up the two types in type definition cache
they do not match.
> Hence when translating a SPIR-V module which contains both usign and
signless integers will contain the same type declaration twice
(something like OpTypeInt 32 0) which is not permitted in SPIR-V and
such generated modules fail validation.
> This patch solves the problem by mapping unisgned integer types to
singless integer types before looking up in the type definition cache.
---------
Signed-off-by: Davide Grohmann <davide.grohmann@arm.com>
|
|
The object file format specific derived classes are used in context like
MCStreamer and MCObjectTargetWriter where the type is statically known.
We don't use isa/dyn_cast and we want to eliminate
MCSection::SectionVariant in the base class.
|
|
Add option to `opt` to run the `ProfileInjectorPass` before the passes opt would run, and then `ProfileVerifierPass` after. This will then be a mode in which we run tests on a specialized buildbot, with the goal of finding passes that drop (and, later, corrupt) profile information.
|
|
We encountered the index of operand out of bounds crash because FCVT_D_W
lacks frm operand.
|
|
There's been a variation of the following in the code since 2005:
if (unoptimizable_true)
return;
use_this_symbol_to_force_linking(); // unreachable but never removed
Way back in 00d5508496c it was the win32 call `GetCurrentProcess`
but switched to `getenv("bar")` fairly soon after in 63e504ff43. While
that pulled in fewer dependencies and made the code portable, it's a
bit of a weird construct. The environment variable used for the `getenv`
call is "bar", which is particularly weird to see fly past when you run
`ltrace` on a binary linked against LLVM.
In this patch I don't try to replace this construct wholesale - it's
still required for architectural reasons I'm not able to tackle right
now, but I did try and make it slightly less weird and opaque:
- It gives the construct a name
- The environment variable hints where this comes from and that its
value is ignored
Combined, this should be a bit of improvement for the next person who
wonders what LLVM is up to when they trace their process or see
smatterings of `getenv("bar")` dotted around the source.
|
|
Summary:
We rely on these flags to do things in the runtime and print the
contents of binaries correctly. CUDA updated their ABI encoding recently
and we didn't handle that. it's a new ABI entirely so we just select on
it when it shows up.
Fixes: https://github.com/llvm/llvm-project/issues/148703
|
|
(#143845)"
This reverts commit 0b054e21f473e258fe0a886fea908fe8bb867bc8.
Breaks many tests, see comments on #143845.
|
|
https://github.com/llvm/llvm-project/pull/92066 will be dependent on
this change
|
|
This patch adds the support for displaying inlined functions into
llvm-objdump.
1) It extends the source variable display
support for inlined functions both for ascii and unicode formats.
2) It also introduces a new format called limits-only that only prints a
line for the start and end of an inlined function without line-drawing
characters.
|
|
This PR adds the SFrameParser class and uses it from llvm-readobj to
dump the section contents. Currently, it only supports parsing the
SFrame section header. Other parts of the section will be added in
follow-up patches.
llvm-readobj uses the same sframe flag syntax as GNU readelf, but I have
not attempted match the output format of the tool. I'm starting with the
"llvm" output format because it's easier to generate and lets us
tweak the format to make it useful for testing the generation code. If
needed, support for the GNU format could be added by overriding this
functionality in the GNU ELF Dumper.
For more information, see the [sframe
specification](https://sourceware.org/binutils/wiki/sframe) and the
related
[RFC](https://discourse.llvm.org/t/rfc-adding-sframe-support-to-llvm/86900).
|
|
Reverts llvm/llvm-project#149433
This broke the hwasan buildbot:
https://lab.llvm.org/buildbot/#/builders/55/builds/14455
|
|
The `--hot-func-list` flag is used for sample profiles to dump the list
of hot functions. Add support to dump hot functions for IRPGO profiles
as well.
This also removes a `priority_queue` used for `--topn`. We can instead
store all functions and sort at the end before dumping. Since we are
storing `StringRef`s, I believe this won't consume too much memory.
|
|
Apply lints and other format fixes to
`llvm/tools/llvm-profdata/llvm-profdata.cpp`. This is intended to have
no functional change.
|
|
Hexagon instructions are VLIW "bundles" of up to four instruction words
encoded as a single MCInst with operands for each sub-instruction.
Previously, the disassembler's getInstruction() returned the full
bundle, which made it difficult to work with llvm-objdump.
For example, since all instructions are bundles, and bundles do not
branch, branch targets could not be printed.
This patch modifies the Hexagon disassembler to return individual
sub-instructions instead of entire bundles, enabling correct printing of
branch targets and relocations. It also introduces
`MCDisassembler::getInstructionBundle` for cases where the full bundle
is still needed.
By default, llvm-objdump separates instructions with newlines. However,
this does not work well for Hexagon syntax:
{ inst1
inst2
inst3
inst4 <branch> } :endloop0
Instructions may be followed by a closing brace, a closing brace with
`:endloop`, or a newline. Branches must appear within the braces.
To address this, `PrettyPrinter::getInstructionSeparator()` is added and
overridden for Hexagon.
|
|
|
|
This is another prune of dead code -- we never generate debug intrinsics
nowadays, therefore there's no need for these codepaths to run.
---------
Co-authored-by: Nikita Popov <github@npopov.com>
|
|
Add support for reading LLVM IR from stdin in the llvm-ir2vec tool.
This allows usage of the tool in pipelines where LLVM IR is generated or transformed on-the-fly just like the other llvm tools. Useful in upcoming PRs.
(Tracking issue - #141817)
|
|
Tracking issues - #141817, #141834
|
|
Add embedding generation functionality to the llvm-ir2vec tool, complementing the existing triplet generation mode.
This change completes the IR2Vec tool by adding the embedding generation functionality, which was previously mentioned as a TODO item. The tool now supports both triplet generation for vocabulary training and embedding generation using a trained vocabulary.
|
|
Add a new LLVM tool `llvm-ir2vec`. This tool is primarily intended to generate triplets for training the vocabulary (#141834) and to potentially generate the embeddings in a stand alone manner.
This PR introduces the tool with triplet generation functionality. In the upcoming PRs I'll add scripts under `utils/mlgo` to complete the vocabulary tooling. #147844 adds embedding generation logic to the tool.
(Tracking issue - #141817)
|
|
Add support for big-endian RISC-V ELF files:
- Add riscv32be/riscv64be target architectures to Triple
- Support elf32-bigriscv and elf64-bigriscv output targets in
llvm-objcopy
- Update ELFObjectFile to handle BE RISC-V format strings and
architecture detection
- Add BE RISC-V support to RelocationResolver
- Add tests for new functionality
This is a subset of a bigger RISC-V big-endian support patch, containing
only the llvm-objcopy and libObject changes. Other changes will be added
later.
|
|
Reference:
https://sourceware.org/git/?p=gnu-gabi.git;a=blob;f=program-loading-and-dynamic-linking.txt;h=3357d865720285df2d29c4e8f92de49ddf1beb40;hb=refs/heads/master
|
|
In c87d198cd964f37343083848f8fdd58bb0b00156, the `__jit_debug_*` symbols
gained explicit dllexport annotations. Unfortunately, mingw's linkers
have a quirk where the presence of any dllexport symbols at all will
switch off the `-export-all-symbols` flag, so without a full conversion
to dllexport annotations (#109483), the mingw LLVM dll build is broken
in LLVM 20+ when building with GCC (when building with clang,
LLVM_ALWAYS_EXPORT expands to the default visibility attribute,
see extended discussion in #148772).
Fix this by adding the flag explicitly as was done for
clang-shlib earlier in https://reviews.llvm.org/D151620.
|
|
* Rename the vague `Value` to `Fill`.
* FillLen is at most 8. Making the field smaller to facilitate encoding
MCAlignFragment as a MCFragment union member.
* Replace an unreachable report_fatal_error with assert.
|
|
'$' indicates immediate values in AT&T syntax, so symbol names starting
with '$' need to be quoted or wrapped in parentheses. Parentheses are
preferred to support expressions with relocation specifiers without
modifying MCExpr internals, aligning with GCC (https://gcc.gnu.org/PR91298).
Add `-output-asm-variant` to llc for testing Intel syntax, avoiding
`-x86-asm-syntax` which affects MCAsmInfo used by input assembly
(-x86-asm-syntax=intel doesn't work with AT&T module asm)
Note: In these positions the symbol name cannot be quoted: `$var:`
`.globl $var` `.type $var, @object`
Close #147587
Pull Request: https://github.com/llvm/llvm-project/pull/147876
|
|
TmpSecPtr is already of const uint8_t *.
|
|
&DICtx is already of DWARFContext *.
|
|
replace arrays (#135607)
This change adds some support to the C DebugInfo capability to create set types,
subrange types, dynamic array types and the ability to replace arrays.
|
|
We should not include both linux/prctl.h and sys/prctl.h. This works
with glibc because the latter includes the former, but breaks with musl
because the latter redeclares the contents of the former, resulting in:
```
/usr/local/aarch64-linux-musl/include/sys/prctl.h:88:8: error:
redefinition of 'struct prctl_mm_map'
88 | struct prctl_mm_map {
| ^~~~~~~~~~~~
In file included from
/checkout/src/llvm-project/llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp:13:
/usr/local/aarch64-linux-musl/include/linux/prctl.h:134:8: note:
previous definition of 'struct prctl_mm_map'
134 | struct prctl_mm_map {
| ^~~~~~~~~~~~
```
Fixes https://github.com/llvm/llvm-project/issues/139443.
|
|
This PR adds a minimal version of `UnwindInfoChecker` described in
[here](https://discourse.llvm.org/t/rfc-dwarf-cfi-validation/86936).
This implementation looks into the modified registers by each
instruction and checks:
- If one of them is the CFA register, and it informs the user if the CFA
data is not modified as well.
- If one of them is used in another register's unwinding rule, it
informs the user if the unwind info is not modified after this
instruction.
This implementation does not support DWARF expressions and treats them
as unknown unwinding rules.
|
|
## Purpose
Add `ProfileData` to `LLVM_LINK_COMPONENTS` for the `yaml2obj` and
`obj2yaml` tools so they link properly when LLVM is built as a Windows
DLL.
## Background
`ProfileData` appears to be a missing dependency from `yaml2obj` and
`obj2yaml`, but when LLVM is built statically it picks-up the required
`LLVMPasses` symbols from a transitive dependency (presumably). When
LLVM is built as a Windows DLL, `yaml2obj` and `obj2yaml` fail to link 3
symbols from `ProfileData` without this change:
```
LLVMCore.lib(Verifier.cpp.obj) : error LNK2019: unresolved external symbol "class std::error_category const & __cdecl llvm::instrprof_category(void)" (?instrprof_category@llvm@@YAAEBVerror_category@std@@XZ) referenced in function "public: virtual class std::error_code __cdecl llvm::InstrProfError::convertToErrorCode(void)const " (?convertToErrorCode@InstrProfError@llvm@@UEBA?AVerror_code@std@@XZ)
LLVMCore.lib(Verifier.cpp.obj) : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl llvm::InstrProfError::message(void)const " (?message@InstrProfError@llvm@@UEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
LLVMCore.lib(Verifier.cpp.obj) : error LNK2019: unresolved external symbol "public: static char llvm::InstrProfError::ID" (?ID@InstrProfError@llvm@@2DA) referenced in function "void __cdecl llvm::handleAllErrors<class `public: static struct std::pair<enum llvm::instrprof_error,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > __cdecl llvm::InstrProfError::take(class llvm::Error)'::`2'::<lambda_1> >(class llvm::Error,class `public: static struct std::pair<enum llvm::instrprof_error,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > __cdecl llvm::InstrProfError::take(class llvm::Error)'::`2'::<lambda_1> &&)" (??$handleAllErrors@V<lambda_1>@?1??take@InstrProfError@llvm@@SA?AU?$pair@W4instrprof_error@llvm@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@VError@4@@Z@@llvm@@YAXVError@0@$$QEAV<lambda_1>@?1??take@InstrProfError@0@SA?AU?$pair@W4instrprof_error@llvm@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@0@Z@@Z)
bin\yaml2obj.exe : fatal error LNK1120: 3 unresolved externals
```
## Validation
Local builds and tests to validate cross-platform compatibility. This
included llvm, clang, and lldb on the following configurations:
- Windows with MSVC
- Windows with Clang
- Linux with GCC
- Linux with Clang
- Darwin with Clang
|
|
At the moment MCDC Record contains ExpandedFileID. If FileID !=
ExpandedFileID, the record's lines LineStart and LineEnd relate to the
`FileID` file, but the record doesn't contain this id. So we can't
distinguish multiple MCDC records with the same lines and columns, but
different FileIDs.
This adds FileID to MCDC records as it is done for regions and branches.
|
|
Currently TargetLibraryInfo assumes ~everything is available, and
specific triples (or the -disable-builtin) flag, opt-out. This is a
backwards system, where features should only be positively be enabled
when known. Add this flag to help migrate tests with no triple.
|
|
Use llvm::fill instead of std::fill
|
|
This removes ThreadSafeContext::Lock, ThreadSafeContext::getLock, and
ThreadSafeContext::getContext, and replaces them with a
ThreadSafeContext::withContextDo method (and const override).
The new method can be used to access an existing
ThreadSafeContext-wrapped LLVMContext in a safe way:
ThreadSafeContext TSCtx = ... ;
TSCtx.withContextDo([](LLVMContext *Ctx) {
// this closure has exclusive access to Ctx.
});
The new API enforces correct locking, whereas the old APIs relied on
manual locking (which almost no in-tree code preformed, relying instead
on incidental exclusive access to the ThreadSafeContext).
|
|
When specifying a weighted input file, the shell does not automatically
expand the tilde (`~`) character in the filename because the argument
is passed as a single string in the format `<weight>,<filename>`.
This commit fixes the issue by using `llvm::sys::fs::expand_tilde` to
explicitly resolve the tilde in the filename, ensuring that paths
like `~/path/to/file` are correctly handled.
|
|
(#145959) (#146112)
Reapply "[NFC][DebugInfo][DWARF] Create new low-level dwarf library (#…
(#145959)
This reapplies cbf781f0bdf2f680abbe784faedeefd6f84c246e, with fixes for
the shared-library build and the unconventional sanitizer-runtime build.
Original Description:
This is the culmination of a series of changes described in [1].
Although somewhat large by line count, it is almost entirely mechanical,
creating a new library in DebugInfo/DWARF/LowLevel. This new library has
very minimal dependencies, allowing it to be used from more places than
the normal DebugInfo/DWARF library--in particular from MC.
1.
https://discourse.llvm.org/t/rfc-debuginfo-dwarf-refactor-into-to-lower-and-higher-level-libraries/86665/2
|
|
ArrayRef now has a new constructor that takes a parameter whose type
has data() and size(). This patch migrates:
ArrayRef<T>(X.data(), X.size()
to:
ArrayRef<T>(X)
|
|
(#145959)
…145081)"
This reverts commit cbf781f0bdf2f680abbe784faedeefd6f84c246e.
Breaks a couple of buildbots.
|
|
This is the culmination of a series of changes described in [1].
Although somewhat large by line count, it is almost entirely mechanical,
creating a new library in DebugInfo/DWARF/LowLevel. This new library has
very minimal dependencies, allowing it to be used from more places than
the normal DebugInfo/DWARF library--in particular from MC.
I am happy to put it in another location, or to structure it differently
if that makes sense. Some have suggested in BinaryFormat, but it is not
a great fit there. But if that makes more sense to the reviewers, I can
do that.
Another possibility would be to use pass-through headers to allow
clients who don't care to depend only on DebugInfo/DWARF. This would be
a much less invasive change, and perhaps easier for clients. But also a
system that hides details.
Either way, I'm open.
1.
https://discourse.llvm.org/t/rfc-debuginfo-dwarf-refactor-into-to-lower-and-higher-level-libraries/86665/2
|
|
Note that llvm::interleaved constructs a string with the elements from
a given range with a given separator.
|