History log of /llvm-project/llvm/lib/Bitcode/Reader/BitcodeReader.cpp (Results 201 – 225 of 1334)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 6398903a 14-Feb-2022 Momchil Velikov <momchil.velikov@arm.com>

Extend the `uwtable` attribute with unwind table kind

We have the `clang -cc1` command-line option `-funwind-tables=1|2` and
the codegen option `VALUE_CODEGENOPT(UnwindTables, 2, 0) ///< Unwind
tabl

Extend the `uwtable` attribute with unwind table kind

We have the `clang -cc1` command-line option `-funwind-tables=1|2` and
the codegen option `VALUE_CODEGENOPT(UnwindTables, 2, 0) ///< Unwind
tables (1) or asynchronous unwind tables (2)`. However, this is
encoded in LLVM IR by the presence or the absence of the `uwtable`
attribute, i.e. we lose the information whether to generate want just
some unwind tables or asynchronous unwind tables.

Asynchronous unwind tables take more space in the runtime image, I'd
estimate something like 80-90% more, as the difference is adding
roughly the same number of CFI directives as for prologues, only a bit
simpler (e.g. `.cfi_offset reg, off` vs. `.cfi_restore reg`). Or even
more, if you consider tail duplication of epilogue blocks.
Asynchronous unwind tables could also restrict code generation to
having only a finite number of frame pointer adjustments (an example
of *not* having a finite number of `SP` adjustments is on AArch64 when
untagging the stack (MTE) in some cases the compiler can modify `SP`
in a loop).
Having the CFI precise up to an instruction generally also means one
cannot bundle together CFI instructions once the prologue is done,
they need to be interspersed with ordinary instructions, which means
extra `DW_CFA_advance_loc` commands, further increasing the unwind
tables size.

That is to say, async unwind tables impose a non-negligible overhead,
yet for the most common use cases (like C++ exceptions), they are not
even needed.

This patch extends the `uwtable` attribute with an optional
value:
- `uwtable` (default to `async`)
- `uwtable(sync)`, synchronous unwind tables
- `uwtable(async)`, asynchronous (instruction precise) unwind tables

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D114543

show more ...


# 4d477ba5 14-Feb-2022 Nikita Popov <npopov@redhat.com>

[BitcodeReader] Rename method for element type by ID (NFC)

Make it clearer that this method is specifically for pointer
element types, and not other element types. This distinction will
be relevant

[BitcodeReader] Rename method for element type by ID (NFC)

Make it clearer that this method is specifically for pointer
element types, and not other element types. This distinction will
be relevant in the future.

The somewhat unusual spelling is to make sure this does not show
up when grepping for getPointerElementType.

show more ...


# c28b0b9d 27-Jan-2022 Nikita Popov <npopov@redhat.com>

[Bitcode] Add partial support for opaque pointer auto-upgrade

Auto-upgrades that rely on the pointer element type do not work in
opaque pointer mode. The idea behind this patch is that we can
instea

[Bitcode] Add partial support for opaque pointer auto-upgrade

Auto-upgrades that rely on the pointer element type do not work in
opaque pointer mode. The idea behind this patch is that we can
instead work with type IDs, for which we can retain the pointer
element type. For typed pointer bitcode, we will have a distinct
type ID for pointers with distinct element type, even if there will
only be a single corresponding opaque pointer type.

The disclaimer here is that this is only the first step of the change,
and there are still more getPointerElementType() calls to remove.
I expect that two more patches will be needed:
1. Track all "contained" type IDs, which will allow us to handle
function params (which are contained in the function type) and GEPs
(which may use vectors of pointers)
2. Track type IDs for values, which is e.g. necessary to handle loads.

Differential Revision: https://reviews.llvm.org/D118694

show more ...


# 72248712 09-Feb-2022 Nikita Popov <npopov@redhat.com>

[Bitcode] Check minimum size of constant GEP record

Checking this early, because we may end up reading up to two
records before the operands.


# 6d52ea88 08-Feb-2022 Nikita Popov <npopov@redhat.com>

[Bitcode] Prevent OOB read for invalid name size


# f4fca0fb 07-Feb-2022 Nikita Popov <npopov@redhat.com>

[Bitcode] Replace assertion with check


# fdf8cb97 07-Feb-2022 Nikita Popov <npopov@redhat.com>

[Bitcode] Handle invalid data layout gracefully


# 0c553bff 07-Feb-2022 Nikita Popov <npopov@redhat.com>

[Bitcode] Guard against out of bounds value reference

We should make sure that the value ID is in bounds, otherwise
we will assert / read out of bounds.


# 89017772 07-Feb-2022 Nikita Popov <npopov@redhat.com>

[Bitcode] Don't assert on invalid attribute group record

Report an error instead.


# f392e9d2 04-Feb-2022 Nikita Popov <npopov@redhat.com>

[BitcodeReader] Resolve error handling todo

If possible, forward the inner error instead of creating a new
one.


# aa97bc11 21-Jan-2022 Nikita Popov <npopov@redhat.com>

[NFC] Remove uses of PointerType::getElementType()

Instead use either Type::getPointerElementType() or
Type::getNonOpaquePointerElementType().

This is part of D117885, in preparation for deprecatin

[NFC] Remove uses of PointerType::getElementType()

Instead use either Type::getPointerElementType() or
Type::getNonOpaquePointerElementType().

This is part of D117885, in preparation for deprecating the API.

show more ...


Revision tags: llvmorg-13.0.1, llvmorg-13.0.1-rc3
# e95ad93e 13-Jan-2022 minglotus-6 <mingmingl@google.com>

[llvm-dis] Add an option `dump-thinlto-index-only` in llvm-dis to read ThinLTO minimized code only.


Revision tags: llvmorg-13.0.1-rc2
# d2cc6c2d 03-Jan-2022 Serge Guelton <sguelton@redhat.com>

Use a sorted array instead of a map to store AttrBuilder string attributes

Using and std::map<SmallString, SmallString> for target dependent attributes is
inefficient: it makes its constructor sligh

Use a sorted array instead of a map to store AttrBuilder string attributes

Using and std::map<SmallString, SmallString> for target dependent attributes is
inefficient: it makes its constructor slightly heavier, and involves extra
allocation for each new string attribute. Storing the attribute key/value as
strings implies extra allocation/copy step.

Use a sorted vector instead. Given the low number of attributes generally
involved, this is cheaper, as showcased by

https://llvm-compile-time-tracker.com/compare.php?from=5de322295f4ade692dc4f1823ae4450ad3c48af2&to=05bc480bf641a9e3b466619af43a2d123ee3f71d&stat=instructions

Differential Revision: https://reviews.llvm.org/D116599

show more ...


# e4d17799 07-Jan-2022 Nikita Popov <npopov@redhat.com>

[IR] Add ConstraintInfo::hasArg() helper (NFC)

Checking whether a constraint corresponds to an argument is a
recurring pattern.


# eddd5be1 06-Jan-2022 Nikita Popov <npopov@redhat.com>

[BitCode] Autoupgrade inline asm elementtype attribute

This is the autoupgrade part of D116531. If old bitcode is missing
the elementtype attribute for indirect inline asm constraints,
automatically

[BitCode] Autoupgrade inline asm elementtype attribute

This is the autoupgrade part of D116531. If old bitcode is missing
the elementtype attribute for indirect inline asm constraints,
automatically add it. As usual, this only works when upgrading
in typed mode, we haven't figured out upgrade in opaque mode yet.

show more ...


# 62b16825 30-Dec-2021 Roman Lebedev <lebedev.ri@gmail.com>

[Opaqueptrs][IR Serialization] Improve inlineasm [de]serialization

The bitcode reader expected that the pointers are typed,
so that it can extract the function type for the assembly
so `bitc::CST_CO

[Opaqueptrs][IR Serialization] Improve inlineasm [de]serialization

The bitcode reader expected that the pointers are typed,
so that it can extract the function type for the assembly
so `bitc::CST_CODE_INLINEASM` did not explicitly store said function type.

I'm not really sure how the upgrade path will look for existing bitcode,
but i think we can easily support opaque pointers going forward,
by simply storing the function type.

Reviewed By: #opaque-pointers, nikic

Differential Revision: https://reviews.llvm.org/D116341

show more ...


# a5337d6a 30-Dec-2021 Roman Lebedev <lebedev.ri@gmail.com>

[BitcodeReader] `bitc::CST_CODE_INLINEASM`: un-hardcode offsets


# d5a4d6a4 28-Dec-2021 Roman Lebedev <lebedev.ri@gmail.com>

[BitcodeReader] propagateAttributeTypes(): fix opaque pointer handling

Can't get the pointee type of an opaque pointer,
but in that case said attributes must already be typed,
so just don't try to r

[BitcodeReader] propagateAttributeTypes(): fix opaque pointer handling

Can't get the pointee type of an opaque pointer,
but in that case said attributes must already be typed,
so just don't try to rewrite them if they already are.

show more ...


Revision tags: llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2
# 5dc8aaac 10-Aug-2021 Sami Tolvanen <samitolvanen@google.com>

[llvm][IR] Add no_cfi constant

With Control-Flow Integrity (CFI), the LowerTypeTests pass replaces
function references with CFI jump table references, which is a problem
for low-level code that need

[llvm][IR] Add no_cfi constant

With Control-Flow Integrity (CFI), the LowerTypeTests pass replaces
function references with CFI jump table references, which is a problem
for low-level code that needs the address of the actual function body.

For example, in the Linux kernel, the code that sets up interrupt
handlers needs to take the address of the interrupt handler function
instead of the CFI jump table, as the jump table may not even be mapped
into memory when an interrupt is triggered.

This change adds the no_cfi constant type, which wraps function
references in a value that LowerTypeTestsModule::replaceCfiUses does not
replace.

Link: https://github.com/ClangBuiltLinux/linux/issues/1353

Reviewed By: nickdesaulniers, pcc

Differential Revision: https://reviews.llvm.org/D108478

show more ...


# 18ab892f 17-Dec-2021 Nikita Popov <npopov@redhat.com>

[Bitcode] Avoid setting invalid comdat pointer (NFC)

Instead track global objects with implicit comdat in a separate
set. The current approach of temporarily assigning an invalid
comdat pointer is i

[Bitcode] Avoid setting invalid comdat pointer (NFC)

Instead track global objects with implicit comdat in a separate
set. The current approach of temporarily assigning an invalid
comdat pointer is incompatible with D115864.

show more ...


# 09a704c5 10-Dec-2021 Mingming Liu <mingmingl@google.com>

[LTO] Ignore unreachable virtual functions in WPD in hybrid LTO.

Differential Revision: https://reviews.llvm.org/D115492


# 7787a8f1 14-Dec-2021 Kazu Hirata <kazu@google.com>

[llvm] Use llvm::reverse (NFC)


# f6bce30c 21-Nov-2021 Kazu Hirata <kazu@google.com>

[llvm] Use range-based for loops (NFC)


# 3c06920c 08-Nov-2021 Kazu Hirata <kazu@google.com>

[llvm] Use make_early_inc_range (NFC)


# 848812a5 01-Nov-2021 Itay Bookstein <ibookstein@gmail.com>

[Verifier] Add verification logic for GlobalIFuncs

Verify that the resolver exists, that it is a defined
Function, and that its return type matches the ifunc's
type. Add corresponding check to Bitco

[Verifier] Add verification logic for GlobalIFuncs

Verify that the resolver exists, that it is a defined
Function, and that its return type matches the ifunc's
type. Add corresponding check to BitcodeReader, change
clang to emit the correct type, and fix tests to comply.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D112349

show more ...


12345678910>>...54