|
Revision tags: llvmorg-21-init, llvmorg-19.1.7 |
|
| #
e4db3f0d |
| 20-Dec-2024 |
serge-sans-paille <sguelton@mozilla.com> |
[llvm] Bail out when meeting pointer with negative offset in approximated mode instead of … (#120424)
…generating empty location
Fix the regression detected by
https://github.com/llvm/llvm-test-
[llvm] Bail out when meeting pointer with negative offset in approximated mode instead of … (#120424)
…generating empty location
Fix the regression detected by
https://github.com/llvm/llvm-test-suite/pull/188
show more ...
|
|
Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4 |
|
| #
1dcb3db0 |
| 18-Nov-2024 |
serge-sans-paille <sguelton@mozilla.com> |
[llvm] Fix behavior of llvm.objectsize in presence of negative / large offset (#115504)
The internal structure used to carry intermediate computations hold
signed values. If an object size happens
[llvm] Fix behavior of llvm.objectsize in presence of negative / large offset (#115504)
The internal structure used to carry intermediate computations hold
signed values. If an object size happens to overflow signed values, we
can get invalid result, so make sure this situation never happens.
This is not very limitative as static allocation of such large values
should scarcely happen.
show more ...
|
| #
01a103b0 |
| 02-Nov-2024 |
serge-sans-paille <sguelton@mozilla.com> |
[llvm] Fix __builtin_object_size interaction between Negative Offset … (#111827)
…and Select/Phi
When picking a SizeOffsetAPInt through combineSizeOffset, the behavior
differs if we're going to
[llvm] Fix __builtin_object_size interaction between Negative Offset … (#111827)
…and Select/Phi
When picking a SizeOffsetAPInt through combineSizeOffset, the behavior
differs if we're going to apply a constant offset that's positive or
negative: If it's positive, then we need to compare the remaining bytes
(i.e. Size
- Offset), but if it's negative, we need to compare the preceding bytes
(i.e. Offset).
Fix #111709
show more ...
|
|
Revision tags: llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init |
|
| #
e578b3be |
| 03-Jul-2023 |
Anshil Gandhi <gandhi21299@gmail.com> |
[InstSimplify] Fold all global variables with initializers
Allow computing size of interposable or externally initializable global variables.
Reviewed By: nikic
Differential Revision: https://revi
[InstSimplify] Fold all global variables with initializers
Allow computing size of interposable or externally initializable global variables.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D152145
show more ...
|
| #
3d5cf0df |
| 14-Jun-2023 |
Alan Zhao <ayzhao@google.com> |
Revert "[InstSimplify] Fold all global variables with initializers"
This reverts commit 17b7df3daee85c1a4d1d955e558d42b34ce17549.
Reason: causes chrome builds to crash: https://crbug.com/1454861
|
| #
17b7df3d |
| 13-Jun-2023 |
Anshil Gandhi <Anshil.Gandhi@amd.com> |
[InstSimplify] Fold all global variables with initializers
Allow computing size of interposable or externally initializable global variables.
Reviewed By: nikic
Differential Revision: https://revi
[InstSimplify] Fold all global variables with initializers
Allow computing size of interposable or externally initializable global variables.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D152145
show more ...
|
|
Revision tags: llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7 |
|
| #
136872a9 |
| 07-Dec-2022 |
Roman Lebedev <lebedev.ri@gmail.com> |
[NFC] Port all LowerConstantIntrinsics tests to `-passes=` syntax
|
|
Revision tags: llvmorg-15.0.6 |
|
| #
e472cf7f |
| 26-Nov-2022 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
LowerConstantIntrinsics: Convert tests to opaque pointers
|
|
Revision tags: llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1 |
|
| #
12c0bf8b |
| 18-Mar-2022 |
Augie Fackler <augie@google.com> |
tests: add attributes that would normally come from inferattrs
As my goal is to remove at least _some_ functions from the static list in MemoryBuiltins.cpp, these tests either need to run inferattrs
tests: add attributes that would normally come from inferattrs
As my goal is to remove at least _some_ functions from the static list in MemoryBuiltins.cpp, these tests either need to run inferattrs or statically declare these attributes to keep passing. A couple of tests had alternate cases which are no longer meaningful, e.g. `malloc-load-removal.ll`.
Differential Revision: https://reviews.llvm.org/D123087
show more ...
|
| #
ab2284a6 |
| 18-Mar-2022 |
Nikita Popov <npopov@redhat.com> |
[LowerConstantIntrinsics] Make TLI a required dependency
The way the pass is actually used in the optimization pipeline, TLI will be available, but this is not the case when running just -lower-cons
[LowerConstantIntrinsics] Make TLI a required dependency
The way the pass is actually used in the optimization pipeline, TLI will be available, but this is not the case when running just -lower-constant-intrinsics in tests, which ends up being quite confusing.
Require TLI unconditionally, as we usually do.
show more ...
|
| #
28c53b38 |
| 18-Mar-2022 |
Nikita Popov <npopov@redhat.com> |
[LowerConstantIntrinsics] Add test for objectsize of malloc (NFC)
This is currently not folded with a plain -lower-constant-intrinsics invocation, because TLI is an optional dependency.
|
|
Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1 |
|
| #
9d43f6d7 |
| 19-Apr-2021 |
Sanjay Patel <spatel@rotateright.com> |
[LowerConstantIntrinsics] avoid crashing on alloca with unexpected operand type
The test here is reduced from the fuzzer-generated crasher in: https://llvm.org/PR50023 https://bugs.chromium.org/p/os
[LowerConstantIntrinsics] avoid crashing on alloca with unexpected operand type
The test here is reduced from the fuzzer-generated crasher in: https://llvm.org/PR50023 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33395
I don't know if this is the best or complete solution, but the zext of the i42 type appears to match the behavior if we run a weird type example like this through the IR optimizer with -O1.
Differential Revision: https://reviews.llvm.org/D100766
show more ...
|
|
Revision tags: llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2 |
|
| #
5e999cbe |
| 05-Jun-2020 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
IR: Define byref parameter attribute
This allows tracking the in-memory type of a pointer argument to a function for ABI purposes. This is essentially a stripped down version of byval to remove some
IR: Define byref parameter attribute
This allows tracking the in-memory type of a pointer argument to a function for ABI purposes. This is essentially a stripped down version of byval to remove some of the stack-copy implications in its definition.
This includes the base IR changes, and some tests for places where it should be treated similarly to byval. Codegen support will be in a future patch.
My original attempt at solving some of these problems was to repurpose byval with a different address space from the stack. However, it is technically permitted for the callee to introduce a write to the argument, although nothing does this in reality. There is also talk of removing and replacing the byval attribute, so a new attribute would need to take its place anyway.
This is intended avoid some optimization issues with the current handling of aggregate arguments, as well as fixes inflexibilty in how frontends can specify the kernel ABI. The most honest representation of the amdgpu_kernel convention is to expose all kernel arguments as loads from constant memory. Today, these are raw, SSA Argument values and codegen is responsible for turning these into loads.
Background:
There currently isn't a satisfactory way to represent how arguments for the amdgpu_kernel calling convention are passed. In reality, arguments are passed in a single, flat, constant memory buffer implicitly passed to the function. It is also illegal to call this function in the IR, and this is only ever invoked by a driver of some kind.
It does not make sense to have a stack passed parameter in this context as is implied by byval. It is never valid to write to the kernel arguments, as this would corrupt the inputs seen by other dispatches of the kernel. These argumets are also not in the same address space as the stack, so a copy is needed to an alloca. From a source C-like language, the kernel parameters are invisible. Semantically, a copy is always required from the constant argument memory to a mutable variable.
The current clang calling convention lowering emits raw values, including aggregates into the function argument list, since using byval would not make sense. This has some unfortunate consequences for the optimizer. In the aggregate case, we end up with an aggregate store to alloca, which both SROA and instcombine turn into a store of each aggregate field. The optimizer never pieces this back together to see that this is really just a copy from constant memory, so we end up stuck with expensive stack usage.
This also means the backend dictates the alignment of arguments, and arbitrarily picks the LLVM IR ABI type alignment. By allowing an explicit alignment, frontends can make better decisions. For example, there's real no advantage to an aligment higher than 4, so a frontend could choose to compact the argument layout. Similarly, there is a high penalty to using an alignment lower than 4, so a frontend could opt into more padding for small arguments.
Another design consideration is when it is appropriate to expose the fact that these arguments are all really passed in adjacent memory. Currently we have a late IR optimization pass in codegen to rewrite the kernel argument values into explicit loads to enable vectorization. In most programs, unrelated argument loads can be merged together. However, exposing this property directly from the frontend has some disadvantages. We still need a way to track the original argument sizes and alignments to report to the driver. I find using some side-channel, metadata mechanism to track this unappealing. If the kernel arguments were exposed as a single buffer to begin with, alias analysis would be unaware that the padding bits betewen arguments are meaningless. Another family of problems is there are still some gaps in replacing all of the available parameter attributes with metadata equivalents once lowered to loads.
The immediate plan is to start using this new attribute to handle all aggregate argumets for kernels. Long term, it makes sense to migrate all kernel arguments, including scalars, to be passed indirectly in the same manner.
Additional context is in D79744.
show more ...
|
| #
7c308dc8 |
| 29-Jun-2020 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
LowerConstantIntrinsics: Fix missing test for byval behavior
|
|
Revision tags: llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1 |
|
| #
9681ea95 |
| 14-Oct-2019 |
Joerg Sonnenberger <joerg@bec.de> |
Reapply r374743 with a fix for the ocaml binding
Add a pass to lower is.constant and objectsize intrinsics
This pass lowers is.constant and objectsize intrinsics not simplified by earlier constant
Reapply r374743 with a fix for the ocaml binding
Add a pass to lower is.constant and objectsize intrinsics
This pass lowers is.constant and objectsize intrinsics not simplified by earlier constant folding, i.e. if the object given is not constant or if not using the optimized pass chain. The result is recursively simplified and constant conditionals are pruned, so that dead blocks are removed even for -O0. This allows inline asm blocks with operand constraints to work all the time.
The new pass replaces the existing lowering in the codegen-prepare pass and fallbacks in SDAG/GlobalISEL and FastISel. The latter now assert on the intrinsics.
Differential Revision: https://reviews.llvm.org/D65280
llvm-svn: 374784
show more ...
|
| #
e4300c39 |
| 13-Oct-2019 |
Joerg Sonnenberger <joerg@bec.de> |
Add a pass to lower is.constant and objectsize intrinsics
This pass lowers is.constant and objectsize intrinsics not simplified by earlier constant folding, i.e. if the object given is not constant
Add a pass to lower is.constant and objectsize intrinsics
This pass lowers is.constant and objectsize intrinsics not simplified by earlier constant folding, i.e. if the object given is not constant or if not using the optimized pass chain. The result is recursively simplified and constant conditionals are pruned, so that dead blocks are removed even for -O0. This allows inline asm blocks with operand constraints to work all the time.
The new pass replaces the existing lowering in the codegen-prepare pass and fallbacks in SDAG/GlobalISEL and FastISel. The latter now assert on the intrinsics.
Differential Revision: https://reviews.llvm.org/D65280
llvm-svn: 374743
show more ...
|