#
29441e4f |
| 29-Jan-2025 |
Nikita Popov <npopov@redhat.com> |
[IR] Convert from nocapture to captures(none) (#123181)
This PR removes the old `nocapture` attribute, replacing it with the new
`captures` attribute introduced in #116990. This change is
intended
[IR] Convert from nocapture to captures(none) (#123181)
This PR removes the old `nocapture` attribute, replacing it with the new
`captures` attribute introduced in #116990. This change is
intended to be essentially NFC, replacing existing uses of `nocapture`
with `captures(none)` without adding any new analysis capabilities.
Making use of non-`none` values is left for a followup.
Some notes:
* `nocapture` will be upgraded to `captures(none)` by the bitcode
reader.
* `nocapture` will also be upgraded by the textual IR reader. This is to
make it easier to use old IR files and somewhat reduce the test churn in
this PR.
* Helper APIs like `doesNotCapture()` will check for `captures(none)`.
* MLIR import will convert `captures(none)` into an `llvm.nocapture`
attribute. The representation in the LLVM IR dialect should be updated
separately.
show more ...
|
Revision tags: llvmorg-21-init, llvmorg-19.1.7 |
|
#
22e9024c |
| 13-Jan-2025 |
Nikita Popov <npopov@redhat.com> |
[IR] Introduce captures attribute (#116990)
This introduces the `captures` attribute as described in:
https://discourse.llvm.org/t/rfc-improvements-to-capture-tracking/81420
This initial patch o
[IR] Introduce captures attribute (#116990)
This introduces the `captures` attribute as described in:
https://discourse.llvm.org/t/rfc-improvements-to-capture-tracking/81420
This initial patch only introduces the IR/bitcode support for the
attribute and its in-memory representation as `CaptureInfo`. This will
be followed by a patch to upgrade and remove the `nocapture` attribute,
and then by actual inference/analysis support.
Based on the RFC feedback, I've used a syntax similar to the `memory`
attribute, though the only "location" that can be specified is `ret`.
I've added some pretty extensive documentation to LangRef on the
semantics. One non-obvious bit here is that using ptrtoint will not
result in a "return-only" capture, even if the ptrtoint result is only
used in the return value. Without this requirement we wouldn't be able
to continue ordinary capture analysis on the return value.
show more ...
|
Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3 |
|
#
69a798a9 |
| 18-Oct-2024 |
goldsteinn <35538541+goldsteinn@users.noreply.github.com> |
Reapply "[Inliner] Propagate more attributes to params when inlining (#91101)" (2nd Attempt) (#112749)
Root cause of the bug was code hanging onto `range` attr after
changing BitWidth. This was fix
Reapply "[Inliner] Propagate more attributes to params when inlining (#91101)" (2nd Attempt) (#112749)
Root cause of the bug was code hanging onto `range` attr after
changing BitWidth. This was fixed in PR #112633.
show more ...
|
#
c85611e8 |
| 17-Oct-2024 |
goldsteinn <35538541+goldsteinn@users.noreply.github.com> |
[SimplifyLibCall][Attribute] Fix bug where we may keep `range` attr with incompatible type (#112649)
In a variety of places we change the bitwidth of a parameter but don't
update the attributes.
[SimplifyLibCall][Attribute] Fix bug where we may keep `range` attr with incompatible type (#112649)
In a variety of places we change the bitwidth of a parameter but don't
update the attributes.
The issue in this case is from the `range` attribute when inlining
`__memset_chk`. `optimizeMemSetChk` will replace an `i32` with an
`i8`, and if the `i32` had a `range` attr assosiated it will cause an
error.
Fixes #112633
show more ...
|
#
9e6d24f6 |
| 16-Oct-2024 |
Arthur Eubanks <aeubanks@google.com> |
Revert "[Inliner] Propagate more attributes to params when inlining (#91101)"
This reverts commit ae778ae7ce72219270c30d5c8b3d88c9a4803f81.
Creates broken IR, see comments in #91101.
|
#
ae778ae7 |
| 16-Oct-2024 |
goldsteinn <35538541+goldsteinn@users.noreply.github.com> |
[Inliner] Propagate more attributes to params when inlining (#91101)
- **[Inliner] Add tests for propagating more parameter attributes; NFC**
- **[Inliner] Propagate more attributes to params when
[Inliner] Propagate more attributes to params when inlining (#91101)
- **[Inliner] Add tests for propagating more parameter attributes; NFC**
- **[Inliner] Propagate more attributes to params when inlining**
Add support for propagating:
- `derefereancable`
- `derefereancable_or_null`
- `align`
- `nonnull`
- `range`
These are only propagated if the parameter to the to-be-inlined callsite
match the exact parameter used in the to-be-inlined function.
show more ...
|
Revision tags: llvmorg-19.1.2 |
|
#
765d7e7a |
| 05-Oct-2024 |
Michael Liao <michael.hliao@gmail.com> |
[IR] Fix '-Wparentheses' warnings. NFC
|
#
e343af77 |
| 02-Oct-2024 |
Noah Goldstein <goldstein.w.n@gmail.com> |
[SimplifyCFG][Attributes] Enabling sinking calls with differing number of attrsets
Prior impl would fail if the number of attribute sets on the two calls wasn't the same which is unnecessary as long
[SimplifyCFG][Attributes] Enabling sinking calls with differing number of attrsets
Prior impl would fail if the number of attribute sets on the two calls wasn't the same which is unnecessary as long as we aren't throwing away and must-preserve attrs.
Closes #110896
show more ...
|
#
95f00a63 |
| 02-Oct-2024 |
Benjamin Maxwell <benjamin.maxwell@arm.com> |
[IR] Allow fast math flags on calls with homogeneous FP struct types (#110506)
This extends FPMathOperator to allow calls that return literal structs
of homogeneous floating-point or vector-of-floa
[IR] Allow fast math flags on calls with homogeneous FP struct types (#110506)
This extends FPMathOperator to allow calls that return literal structs
of homogeneous floating-point or vector-of-floating-point types.
The intended use case for this is to support FP intrinsics that return
multiple values (such as `llvm.sincos`).
show more ...
|
#
afc0557a |
| 01-Oct-2024 |
goldsteinn <35538541+goldsteinn@users.noreply.github.com> |
[IR][Attribute] Add support for intersecting AttributeLists; NFC (#109719)
Add support for taking the intersection of two AttributeLists s.t the
result list contains attributes that are valid in th
[IR][Attribute] Add support for intersecting AttributeLists; NFC (#109719)
Add support for taking the intersection of two AttributeLists s.t the
result list contains attributes that are valid in the context of both
inputs.
i.e if we have `nonnull align(32) noundef` intersected with `nonnull
align(16) dereferenceable(10)`, the result is `nonnull align(16)`.
Further it handles attributes that are not-droppable. For example
dropping `byval` can change the nature of a callsite/function so its
impossible to correct a correct intersection if its dropped from the
result. i.e `nonnull byval(i64)` intersected with `nonnull` is
invalid.
The motivation for the infrastructure is to enable sinking/hoisting
callsites with differing attributes.
show more ...
|
Revision tags: llvmorg-19.1.1 |
|
#
29168e80 |
| 24-Sep-2024 |
Noah Goldstein <goldstein.w.n@gmail.com> |
[IR][Attribute] Add missing `const` def on `addAllocSizeParamAttr()`; NFC
|
Revision tags: llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3 |
|
#
04da7730 |
| 08-Aug-2024 |
Andreas Jonson <andjo403@hotmail.com> |
Allow empty range attribute and add assert for full range (#100601)
fix #99619
|
Revision tags: llvmorg-19.1.0-rc2 |
|
#
7df9da7d |
| 04-Aug-2024 |
Kazu Hirata <kazu@google.com> |
[llvm] Construct SmallVector with ArrayRef (NFC) (#101872)
|
Revision tags: llvmorg-19.1.0-rc1, llvmorg-20-init |
|
#
5ece35df |
| 21-Jun-2024 |
Haopeng Liu <153236845+haopliu@users.noreply.github.com> |
Add the 'initializes' attribute langref and support (#84803)
We propose adding a new LLVM attribute,
`initializes((Lo1,Hi1),(Lo2,Hi2),...)`, which expresses the notion of
memory space (i.e., inter
Add the 'initializes' attribute langref and support (#84803)
We propose adding a new LLVM attribute,
`initializes((Lo1,Hi1),(Lo2,Hi2),...)`, which expresses the notion of
memory space (i.e., intervals, in bytes) that the argument pointing to
is initialized in the function.
Will commit the attribute inferring in the follow-up PRs.
https://discourse.llvm.org/t/rfc-llvm-new-initialized-parameter-attribute-for-improved-interprocedural-dse/77337
show more ...
|
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7 |
|
#
ab08df22 |
| 02-Jun-2024 |
Joshua Cao <cao.joshua@yahoo.com> |
[IR] Do not set `none` for function uwtable (#93387)
This avoids the pitfall where we set the uwtable to none:
```
func.setUWTableKind(llvm::UWTableKind::None)
```
`Attribute::getAsString()` wou
[IR] Do not set `none` for function uwtable (#93387)
This avoids the pitfall where we set the uwtable to none:
```
func.setUWTableKind(llvm::UWTableKind::None)
```
`Attribute::getAsString()` would see an unknown attribute and fail an
assertion. In this patch, we assert that we do not see a None uwtable
kind.
This also skips the check of `UWTableKind::Async`. It is dominated by
the check of `UWTableKind::Default`, which has the same enum value
(nfc).
show more ...
|
Revision tags: llvmorg-18.1.6 |
|
#
3d65bd93 |
| 02-May-2024 |
Andreas Jonson <andjo403@hotmail.com> |
[NFC] Reduce copies created of ConstantRange when getting ConstantRangeAttributes (#90335)
Think that it can be good to reduce the number of copies created when
working with ConstantRangeAttributes.
|
Revision tags: llvmorg-18.1.5 |
|
#
4e6f6fda |
| 30-Apr-2024 |
Kazu Hirata <kazu@google.com> |
[IR] Use StringRef::operator== instead of StringRef::equals (NFC) (#90550)
I'm planning to remove StringRef::equals in favor of
StringRef::operator==.
- StringRef::operator== outnumbers StringRe
[IR] Use StringRef::operator== instead of StringRef::equals (NFC) (#90550)
I'm planning to remove StringRef::equals in favor of
StringRef::operator==.
- StringRef::operator== outnumbers StringRef::equals by a factor of 22
under llvm/ in terms of their usage.
- The elimination of StringRef::equals brings StringRef closer to
std::string_view, which has operator== but not equals.
- S == "foo" is more readable than S.equals("foo"), especially for
!Long.Expression.equals("str") vs Long.Expression != "str".
show more ...
|
#
9a1386e5 |
| 30-Apr-2024 |
Andreas Jonson <andjo403@hotmail.com> |
[NFC] Remove method from FoldingSet that already existed in APInt. (#90486)
Noticed that there already was a function in APInt that updated a
FoldingSet so there was no need for me to add it in
ht
[NFC] Remove method from FoldingSet that already existed in APInt. (#90486)
Noticed that there already was a function in APInt that updated a
FoldingSet so there was no need for me to add it in
https://github.com/llvm/llvm-project/pull/84617.
show more ...
|
#
b8f3024a |
| 24-Apr-2024 |
Andreas Jonson <andjo403@hotmail.com> |
[InstCombine] Swap out range metadata to range attribute for cttz/ctlz/ctpop (#88776)
Since all optimizations that use range metadata now also handle range attribute, this patch replaces writes of
[InstCombine] Swap out range metadata to range attribute for cttz/ctlz/ctpop (#88776)
Since all optimizations that use range metadata now also handle range attribute, this patch replaces writes of
range metadata for call instructions to range attributes.
show more ...
|
Revision tags: llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2 |
|
#
40282674 |
| 09-Mar-2024 |
Andreas Jonson <andjo403@hotmail.com> |
Reapply [IR] Add new Range attribute using new ConstantRange Attribute type (#84617)
The only change from https://github.com/llvm/llvm-project/pull/83171 is the
change of the allocator so the destr
Reapply [IR] Add new Range attribute using new ConstantRange Attribute type (#84617)
The only change from https://github.com/llvm/llvm-project/pull/83171 is the
change of the allocator so the destructor is called for
ConstantRangeAttributeImpl.
reverts https://github.com/llvm/llvm-project/pull/84549
show more ...
|
#
0861755e |
| 08-Mar-2024 |
Florian Mayer <fmayer@google.com> |
Revert "[IR] Add new Range attribute using new ConstantRange Attribute type" (#84549)
Reverts llvm/llvm-project#83171
broke sanitizer buildbot
https://lab.llvm.org/buildbot/#/builders/168/builds
Revert "[IR] Add new Range attribute using new ConstantRange Attribute type" (#84549)
Reverts llvm/llvm-project#83171
broke sanitizer buildbot
https://lab.llvm.org/buildbot/#/builders/168/builds/19110/steps/10/logs/stdio
show more ...
|
#
e0d49066 |
| 08-Mar-2024 |
Andreas Jonson <andjo403@hotmail.com> |
[IR] Add new Range attribute using new ConstantRange Attribute type (#83171)
implementation as discussed in
https://discourse.llvm.org/t/rfc-metadata-attachments-for-function-arguments/76420
|
Revision tags: llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4 |
|
#
8eb67575 |
| 25-Feb-2024 |
Dani <daniel.kiss@arm.com> |
[NFC] Turn the StrictFP attribute check to a CompatRule. (#82600)
|
#
6fae3e78 |
| 23-Feb-2024 |
Dani <DanielKristofKiss@users.noreply.github.com> |
[llvm][AArch64] Do not inline a function with different signing scheme. (#80642)
If the signing scheme is different that maybe the functions assumes
different behaviours and dangerous to inline the
[llvm][AArch64] Do not inline a function with different signing scheme. (#80642)
If the signing scheme is different that maybe the functions assumes
different behaviours and dangerous to inline them without analysing
them. This should be a rare case.
show more ...
|
Revision tags: llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init |
|
#
bf5d96c9 |
| 14-Dec-2023 |
Nikita Popov <npopov@redhat.com> |
[IR] Add dead_on_unwind attribute (#74289)
Add the `dead_on_unwind` attribute, which states that the caller will
not read from this argument if the call unwinds. This allows eliding
stores that co
[IR] Add dead_on_unwind attribute (#74289)
Add the `dead_on_unwind` attribute, which states that the caller will
not read from this argument if the call unwinds. This allows eliding
stores that could otherwise be visible on the unwind path, for example:
```
declare void @may_unwind()
define void @src(ptr noalias dead_on_unwind %out) {
store i32 0, ptr %out
call void @may_unwind()
store i32 1, ptr %out
ret void
}
define void @tgt(ptr noalias dead_on_unwind %out) {
call void @may_unwind()
store i32 1, ptr %out
ret void
}
```
The optimization is not valid without `dead_on_unwind`, because the `i32
0` value might be read if `@may_unwind` unwinds.
This attribute is primarily intended to be used on sret arguments. In
fact, I previously wanted to change the semantics of sret to include
this "no read after unwind" property (see D116998), but based on the
feedback there it is better to keep these attributes orthogonal (sret is
an ABI attribute, dead_on_unwind is an optimization attribute). This is
a reboot of that change with a separate attribute.
show more ...
|