LLVM/project e356af4llvm/test/CodeGen/AMDGPU memory-legalizer-global-agent.ll memory-legalizer-global-workgroup.ll

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]
DeltaFile
+13,404-6,344llvm/test/CodeGen/AMDGPU/memory-legalizer-global-agent.ll
+12,949-6,549llvm/test/CodeGen/AMDGPU/memory-legalizer-global-workgroup.ll
+12,712-6,088llvm/test/CodeGen/AMDGPU/memory-legalizer-global-system.ll
+12,041-6,669llvm/test/CodeGen/AMDGPU/memory-legalizer-global-singlethread.ll
+12,041-6,669llvm/test/CodeGen/AMDGPU/memory-legalizer-global-wavefront.ll
+12,958-4,611llvm/test/CodeGen/AMDGPU/memory-legalizer-flat-agent.ll
+76,105-36,9303,022 files not shown
+342,721-141,4563,028 files

LLVM/project 5c7c938llvm/test/CodeGen/AMDGPU memory-legalizer-global-agent.ll memory-legalizer-global-workgroup.ll

rebase

Created using spr 1.3.4
DeltaFile
+13,404-6,344llvm/test/CodeGen/AMDGPU/memory-legalizer-global-agent.ll
+12,949-6,549llvm/test/CodeGen/AMDGPU/memory-legalizer-global-workgroup.ll
+12,712-6,088llvm/test/CodeGen/AMDGPU/memory-legalizer-global-system.ll
+12,041-6,669llvm/test/CodeGen/AMDGPU/memory-legalizer-global-wavefront.ll
+12,041-6,669llvm/test/CodeGen/AMDGPU/memory-legalizer-global-singlethread.ll
+12,958-4,611llvm/test/CodeGen/AMDGPU/memory-legalizer-flat-system.ll
+76,105-36,9303,022 files not shown
+342,721-141,4563,028 files

LLVM/project 9e6c96cllvm/test/CodeGen/AMDGPU memory-legalizer-global-agent.ll memory-legalizer-global-workgroup.ll

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]
DeltaFile
+13,404-6,344llvm/test/CodeGen/AMDGPU/memory-legalizer-global-agent.ll
+12,949-6,549llvm/test/CodeGen/AMDGPU/memory-legalizer-global-workgroup.ll
+12,712-6,088llvm/test/CodeGen/AMDGPU/memory-legalizer-global-system.ll
+12,041-6,669llvm/test/CodeGen/AMDGPU/memory-legalizer-global-wavefront.ll
+12,041-6,669llvm/test/CodeGen/AMDGPU/memory-legalizer-global-singlethread.ll
+12,958-4,611llvm/test/CodeGen/AMDGPU/memory-legalizer-flat-agent.ll
+76,105-36,9303,022 files not shown
+342,721-141,4563,028 files

LLVM/project caef77cllvm/test/CodeGen/AMDGPU memory-legalizer-global-agent.ll memory-legalizer-global-workgroup.ll

rebase

Created using spr 1.3.4
DeltaFile
+13,404-6,344llvm/test/CodeGen/AMDGPU/memory-legalizer-global-agent.ll
+12,949-6,549llvm/test/CodeGen/AMDGPU/memory-legalizer-global-workgroup.ll
+12,712-6,088llvm/test/CodeGen/AMDGPU/memory-legalizer-global-system.ll
+12,041-6,669llvm/test/CodeGen/AMDGPU/memory-legalizer-global-wavefront.ll
+12,041-6,669llvm/test/CodeGen/AMDGPU/memory-legalizer-global-singlethread.ll
+12,958-4,611llvm/test/CodeGen/AMDGPU/memory-legalizer-flat-system.ll
+76,105-36,9303,022 files not shown
+342,721-141,4563,028 files

LLVM/project cd3a4c3llvm/test/Transforms/Attributor depgraph.ll nonnull.ll, llvm/test/Transforms/OpenMP spmdization.ll custom_state_machines_pre_lto.ll

[Attributor][NFC] update tests (#91011)

DeltaFile
+156-156llvm/test/Transforms/OpenMP/spmdization.ll
+0-186llvm/test/Transforms/Attributor/depgraph.ll
+86-87llvm/test/Transforms/Attributor/nonnull.ll
+72-72llvm/test/Transforms/OpenMP/custom_state_machines_pre_lto.ll
+87-48llvm/test/Transforms/OpenMP/barrier_removal.ll
+66-66llvm/test/Transforms/OpenMP/custom_state_machines.ll
+467-61597 files not shown
+1,338-1,398103 files

LLVM/project aae749bllvm/include/llvm/Transforms/IPO Attributor.h, llvm/lib/Transforms/IPO AttributorAttributes.cpp Attributor.cpp

[Attributor] Port AANoAlias to the isImpliedByIR interface

As part of this we do not annotate literal `null` and `undef/poison` as
`noalias` anymore. This was not really needed anyway.
DeltaFile
+49-79llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+10-10llvm/test/Transforms/Attributor/callbacks.ll
+4-13llvm/include/llvm/Transforms/IPO/Attributor.h
+8-8llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll
+5-5llvm/test/Transforms/Attributor/value-simplify.ll
+3-6llvm/lib/Transforms/IPO/Attributor.cpp
+79-12113 files not shown
+108-15019 files

LLVM/project ebec3ddllvm/include/llvm/Transforms/IPO Attributor.h, llvm/lib/Transforms/IPO AttributorAttributes.cpp Attributor.cpp

[Attributor] Port AANoCapture to the isImpliedByIR interface

AANoCapture is now the first non-boolean AA that is always queried via
the new APIs and not created manually.

We explicitly do not manifest nocapture for `null` and `undef` anymore.
DeltaFile
+136-92llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+11-10llvm/lib/Transforms/IPO/Attributor.cpp
+10-10llvm/test/Transforms/Attributor/callbacks.ll
+16-2llvm/include/llvm/Transforms/IPO/Attributor.h
+8-8llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll
+5-5llvm/test/Transforms/Attributor/value-simplify.ll
+186-1278 files not shown
+202-14314 files

LLVM/project 02a4fcellvm/include/llvm/Transforms/IPO Attributor.h, llvm/lib/Transforms/IPO AttributorAttributes.cpp Attributor.cpp

[Attributor] Port AANonNull to the isImpliedByIR interface

AANonNull is now the first AA that is always queried via the new APIs
and not created manually. Others will follow shortly to avoid trivial
AAs whenever possible.

This commit introduced some helper logic that will make it simpler to
port the next one. It also untangles AADereferenceable and AANonNull
such that the former does not keep a handle on the latter. Finally,
we stop deducing `nonnull` for `undef`, which was incorrect.
DeltaFile
+211-148llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+44-25llvm/include/llvm/Transforms/IPO/Attributor.h
+24-14llvm/lib/Transforms/IPO/Attributor.cpp
+12-24llvm/test/Transforms/Attributor/liveness.ll
+16-16llvm/test/Transforms/OpenMP/parallel_region_merging.ll
+16-16llvm/test/Transforms/Attributor/value-simplify.ll
+323-24328 files not shown
+441-37634 files

LLVM/project d33bca8llvm/include/llvm/Transforms/IPO Attributor.h, llvm/test/Transforms/Attributor returned.ll

[Attributor] Introduce helpers to judge AAs prior to creation

This is a partial cleanup to centralize the initialization and update
decisions for AAs. Lifting the burdon and boilerplate on users and
making it harder to accidentally perform unsound deductions.

The two static helpers show how we can lift the decisions to generate an
AA into the Attributor, avoiding trivial AAs that just cost us compile
time and maintenance code (to check for pre-conditions).
DeltaFile
+164-168llvm/test/Transforms/OpenMP/spmdization.ll
+144-144llvm/test/Transforms/OpenMP/custom_state_machines.ll
+72-72llvm/test/Transforms/OpenMP/custom_state_machines_pre_lto.ll
+90-34llvm/include/llvm/Transforms/IPO/Attributor.h
+52-0llvm/test/Transforms/Attributor/reduced/openmp_opt_constant_type_crash.ll
+14-29llvm/test/Transforms/Attributor/returned.ll
+536-44717 files not shown
+591-49523 files

LLVM/project badafc5llvm/lib/Transforms/IPO AttributorAttributes.cpp, llvm/test/Transforms/Attributor value-simplify-assume.ll liveness.ll

[Attributor] Check IR attributes before creating new AAs

Instead of creating an AA for an IR attribute we can first check if it
is implied/known. If so, we can save the time to create the AA, figure
out it is implied, fix it, and later manifest it in the IR
(redundantly). Other IR attributes can be added to the list in
`AA::hasAssumedIRAttr` later on, for now we support 8 different ones.
DeltaFile
+202-364llvm/test/Transforms/Attributor/value-simplify-assume.ll
+161-172llvm/test/Transforms/Attributor/liveness.ll
+132-116llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+91-114llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+106-57llvm/test/Transforms/Attributor/memory_locations.ll
+71-71llvm/test/Transforms/Attributor/nofpclass-ldexp.ll
+763-89485 files not shown
+1,914-2,11891 files

LLVM/project 23dafbbllvm/lib/Transforms/IPO Attributor.cpp, llvm/test/Transforms/Attributor new_attributes.ll internalize.ll

[Attributor] Remove the iteration count verification

It was never really useful to track #iterations, though it helped during
the initial development. What we should track, in a follow up, are
potentially #updates. That is also what we should restrict instead of
the #iterations.
DeltaFile
+1-14llvm/lib/Transforms/IPO/Attributor.cpp
+1-4llvm/test/Transforms/Attributor/new_attributes.ll
+2-2llvm/test/Transforms/Attributor/internalize.ll
+2-2llvm/test/Transforms/Attributor/reduced/register_benchmark_test.ll
+1-1llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll
+1-1llvm/test/Transforms/Attributor/IPConstantProp/global.ll
+8-24122 files not shown
+130-146128 files

LLVM/project 4f4787ellvm/test/Transforms/Attributor nonnull.ll value-simplify-assume.ll, llvm/test/Transforms/Attributor/reduced register_benchmark_test.ll

[Attributor] Convert some tests to opaque pointers (NFC)

These were converted without adjustments.
DeltaFile
+502-505llvm/test/Transforms/Attributor/nonnull.ll
+497-497llvm/test/Transforms/Attributor/reduced/register_benchmark_test.ll
+389-389llvm/test/Transforms/Attributor/value-simplify-assume.ll
+344-352llvm/test/Transforms/Attributor/nocapture-1.ll
+198-198llvm/test/Transforms/Attributor/memory_locations.ll
+163-176llvm/test/Transforms/Attributor/value-simplify.ll
+2,093-2,11758 files not shown
+4,048-4,13864 files

LLVM/project 23333bbllvm/test/Transforms/Attributor callgraph.ll value-simplify-pointer-info-struct.ll, llvm/test/Transforms/Attributor/reduced crash_ptr2int_cgscc.ll

[NFC] Rerun update test checks on Attributor and OpenMP-Opt tests
DeltaFile
+9-9llvm/test/Transforms/OpenMP/remove_noinline_attributes.ll
+9-7llvm/test/Transforms/Attributor/callgraph.ll
+13-0llvm/test/Transforms/Attributor/value-simplify-pointer-info-struct.ll
+2-2llvm/test/Transforms/OpenMP/always_inline_device.ll
+3-0llvm/test/Transforms/Attributor/reduced/crash_ptr2int_cgscc.ll
+3-0llvm/test/Transforms/Attributor/reachability.ll
+39-1848 files not shown
+150-1954 files

LLVM/project 846709bllvm/test/Transforms/Attributor value-simplify-pointer-info.ll liveness.ll

[Attribute] Clean up test prefixes (NFC)

Now that the legacy PM is no longer tested, the huge matrix of
test prefixes used by attributor tests is no longer needed and very
confusing for the casual reader. Reduce the prefixes down to just
CHECK, TUNIT and CGSCC.
DeltaFile
+1,632-1,632llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+1,092-1,092llvm/test/Transforms/Attributor/liveness.ll
+948-948llvm/test/Transforms/Attributor/range.ll
+751-751llvm/test/Transforms/Attributor/value-simplify-assume.ll
+610-610llvm/test/Transforms/Attributor/nonnull.ll
+578-578llvm/test/Transforms/Attributor/value-simplify.ll
+5,611-5,611105 files not shown
+14,120-14,122111 files

LLVM/project 99c9b37llvm/test/Transforms/Attributor value-simplify-pointer-info.ll range.ll, llvm/test/Transforms/Attributor/ArgumentPromotion/X86 min-legal-vector-width.ll

[NFC][1/n] Remove -enable-new-pm=0 flags from lit tests

This is the first patch in a series intended for removing flag
-enable-new-pm=0 from lit tests. This is part of a bigger
effort of completely removing legacy code related to legacy
pass manager in favor of currently default new pass manager.

In this patch flag has been removed only from tests where no significant
change has been required because checks has been duplicated for
both PMs.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D134150
DeltaFile
+0-1,605llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+0-1,217llvm/test/Transforms/OpenMP/parallel_region_merging.ll
+0-812llvm/test/Transforms/Attributor/range.ll
+0-480llvm/test/Transforms/Attributor/willreturn.ll
+0-399llvm/test/Transforms/Attributor/value-simplify.ll
+0-292llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll
+0-4,805145 files not shown
+0-7,484151 files

LLVM/project bf789b1llvm/lib/Transforms/IPO AttributorAttributes.cpp, llvm/test/Transforms/Attributor range.ll value-simplify-pointer-info.ll

[Attributor] Replace AAValueSimplify with AAPotentialValues

For the longest time we used `AAValueSimplify` and
`genericValueTraversal` to determine "potential values". This was
problematic for many reasons:
- We recomputed the result a lot as there was no caching for the 9
  locations calling `genericValueTraversal`.
- We added the idea of "intra" vs. "inter" procedural simplification
  only as an afterthought. `genericValueTraversal` did offer an option
  but `AAValueSimplify` did not. Thus, we might end up with "too much"
  simplification in certain situations and then gave up on it.
- Because `genericValueTraversal` was not a real `AA` we ended up with
  problems like the infinite recursion bug (#54981) as well as code
  duplication.

This patch introduces `AAPotentialValues` and replaces the
`AAValueSimplify` uses with it. `genericValueTraversal` is folded into
`AAPotentialValues` as are the instruction simplifications performed in
`AAValueSimplify` before. We further distinguish "intra" and "inter"

    [15 lines not shown]
DeltaFile
+1,086-722llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+747-283llvm/test/Transforms/Attributor/range.ll
+510-518llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+802-0llvm/test/Transforms/Attributor/value-simplify-local-remote.ll
+160-95llvm/test/Transforms/Attributor/potential.ll
+146-96llvm/test/Transforms/Attributor/depgraph.ll
+3,451-1,71467 files not shown
+4,558-2,85773 files

LLVM/project f6e0c05llvm/lib/Transforms/IPO AttributorAttributes.cpp, llvm/test/Transforms/Attributor range.ll value-simplify-pointer-info.ll

Revert "[Attributor] Replace AAValueSimplify with AAPotentialValues"

This reverts commit f17639ea0cd30f52ac853ba2eb25518426cc3bb8 as three
AMDGPU tests haven't been updated. Will need to verify the changes are
not regressions we should avoid.
DeltaFile
+721-1,085llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+283-747llvm/test/Transforms/Attributor/range.ll
+518-510llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+0-802llvm/test/Transforms/Attributor/value-simplify-local-remote.ll
+95-160llvm/test/Transforms/Attributor/potential.ll
+96-146llvm/test/Transforms/Attributor/depgraph.ll
+1,713-3,45066 files not shown
+2,855-4,55572 files

LLVM/project f17639ellvm/lib/Transforms/IPO AttributorAttributes.cpp, llvm/test/Transforms/Attributor range.ll value-simplify-pointer-info.ll

[Attributor] Replace AAValueSimplify with AAPotentialValues

For the longest time we used `AAValueSimplify` and
`genericValueTraversal` to determine "potential values". This was
problematic for many reasons:
- We recomputed the result a lot as there was no caching for the 9
  locations calling `genericValueTraversal`.
- We added the idea of "intra" vs. "inter" procedural simplification
  only as an afterthought. `genericValueTraversal` did offer an option
  but `AAValueSimplify` did not. Thus, we might end up with "too much"
  simplification in certain situations and then gave up on it.
- Because `genericValueTraversal` was not a real `AA` we ended up with
  problems like the infinite recursion bug (#54981) as well as code
  duplication.

This patch introduces `AAPotentialValues` and replaces the
`AAValueSimplify` uses with it. `genericValueTraversal` is folded into
`AAPotentialValues` as are the instruction simplifications performed in
`AAValueSimplify` before. We further distinguish "intra" and "inter"

    [15 lines not shown]
DeltaFile
+1,086-722llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+747-283llvm/test/Transforms/Attributor/range.ll
+510-518llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+802-0llvm/test/Transforms/Attributor/value-simplify-local-remote.ll
+160-95llvm/test/Transforms/Attributor/potential.ll
+146-96llvm/test/Transforms/Attributor/depgraph.ll
+3,451-1,71466 files not shown
+4,556-2,85672 files

LLVM/project 6555558llvm/lib/Transforms/IPO AttributorAttributes.cpp Attributor.cpp, llvm/test/Transforms/Attributor value-simplify-pointer-info.ll liveness.ll

Revert "[Attributor] Replace AAValueSimplify with AAPotentialValues"

This reverts commit da50dab1ae111e9e6cb0248a47a038b17f798705.

Patch broke AMD GPU OpenMP offload buildbots.
https://lab.llvm.org/buildbot/#/builders/193/builds/13246
DeltaFile
+1,229-760llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+722-1,077llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+593-1,045llvm/test/Transforms/Attributor/liveness.ll
+0-794llvm/test/Transforms/Attributor/value-simplify-local-remote.ll
+81-155llvm/test/Transforms/Attributor/depgraph.ll
+54-113llvm/lib/Transforms/IPO/Attributor.cpp
+2,679-3,94467 files not shown
+3,676-4,92473 files

LLVM/project da50dabllvm/lib/Transforms/IPO AttributorAttributes.cpp Attributor.cpp, llvm/test/Transforms/Attributor value-simplify-pointer-info.ll liveness.ll

[Attributor] Replace AAValueSimplify with AAPotentialValues

For the longest time we used `AAValueSimplify` and
`genericValueTraversal` to determine "potential values". This was
problematic for many reasons:
- We recomputed the result a lot as there was no caching for the 9
  locations calling `genericValueTraversal`.
- We added the idea of "intra" vs. "inter" procedural simplification
  only as an afterthought. `genericValueTraversal` did offer an option
  but `AAValueSimplify` did not. Thus, we might end up with "too much"
  simplification in certain situations and then gave up on it.
- Because `genericValueTraversal` was not a real `AA` we ended up with
  problems like the infinite recursion bug (#54981) as well as code
  duplication.

This patch introduces `AAPotentialValues` and replaces the
`AAValueSimplify` uses with it. `genericValueTraversal` is folded into
`AAPotentialValues` as are the instruction simplifications performed in
`AAValueSimplify` before. We further distinguish "intra" and "inter"

    [12 lines not shown]
DeltaFile
+760-1,229llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+1,078-723llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+1,045-593llvm/test/Transforms/Attributor/liveness.ll
+794-0llvm/test/Transforms/Attributor/value-simplify-local-remote.ll
+155-81llvm/test/Transforms/Attributor/depgraph.ll
+113-54llvm/lib/Transforms/IPO/Attributor.cpp
+3,945-2,68067 files not shown
+4,925-3,67773 files

LLVM/project 09c8983libcxx/test/std/language.support/support.limits/support.limits.general version.version.pass.cpp version.version.compile.pass.cpp, libcxx/test/std/utilities/format/format.functions locale-specific_form.pass.cpp

Merge branch 'main' into irbuilder-extract-refactor
DeltaFile
+4,801-4,803llvm/lib/Target/AArch64/AArch64PerfectShuffle.h
+0-5,015libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp
+4,996-0libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
+2,023-2,020llvm/docs/AMDGPU/AMDGPUAsmGFX10.rst
+1,653-1,649libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
+2,963-0llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp
+16,436-13,4877,445 files not shown
+205,894-116,0887,451 files

LLVM/project e87f10allvm/test/Transforms/Attributor range.ll value-simplify-pointer-info.ll

[Attributor] CGSCC pass should not recompute results outside the SCC (reapply)

When we run the CGSCC pass we should only invest time on the SCC. We can
initialize AAs with information from the module slice but we should not
update those AAs. We make an exception for are call site of the SCC as
they are helpful providing information for the SCC.

Minor modifications to pointer privatization allow us to perform it even
in the CGSCC pass, similar to ArgumentPromotion.
DeltaFile
+1,104-438llvm/test/Transforms/Attributor/range.ll
+953-517llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+767-365llvm/test/Transforms/Attributor/value-simplify-assume.ll
+479-467llvm/test/Transforms/Attributor/align.ll
+596-239llvm/test/Transforms/Attributor/value-simplify.ll
+460-238llvm/test/Transforms/Attributor/returned.ll
+4,359-2,26473 files not shown
+8,757-4,61579 files

LLVM/project 39a68ccllvm/test/Transforms/Attributor range.ll value-simplify-pointer-info.ll

Revert "[Attributor] CGSCC pass should not recompute results outside the SCC"

This reverts commit 0d7f81e31315f8cda56ce6fde5ff5145e0325c51, it caused
the AMDGPU tests that use the Attributor to fail.
DeltaFile
+438-1,104llvm/test/Transforms/Attributor/range.ll
+521-949llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+365-767llvm/test/Transforms/Attributor/value-simplify-assume.ll
+472-484llvm/test/Transforms/Attributor/align.ll
+246-606llvm/test/Transforms/Attributor/value-simplify.ll
+238-460llvm/test/Transforms/Attributor/returned.ll
+2,280-4,37076 files not shown
+5,069-9,00382 files

LLVM/project 0d7f81ellvm/test/Transforms/Attributor range.ll value-simplify-pointer-info.ll

[Attributor] CGSCC pass should not recompute results outside the SCC

When we run the CGSCC pass we should only invest time on the SCC. We can
initialize AAs with information from the module slice but we should not
update those AAs.
DeltaFile
+1,104-438llvm/test/Transforms/Attributor/range.ll
+949-521llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+767-365llvm/test/Transforms/Attributor/value-simplify-assume.ll
+484-472llvm/test/Transforms/Attributor/align.ll
+606-246llvm/test/Transforms/Attributor/value-simplify.ll
+460-238llvm/test/Transforms/Attributor/returned.ll
+4,370-2,28076 files not shown
+9,003-5,06982 files

LLVM/project af30de7llvm/include/llvm/Transforms/IPO Attributor.h, llvm/lib/Transforms/IPO AttributorAttributes.cpp Attributor.cpp

[Attributor] Introduce AAInstanceInfo

The Attributor, as many other parts in LLVM, uses pointer equivalence
for `llvm::Value`s. This only works as long as `llvm::Value`s are
dynamically unique, or, to be exact, we will never end up with the same
`llvm::Value` representing two dynamic instances. We already provided a
helper to check the former, namely `AA::isDynamicallyUnique`, however we
could not check the latter. In this patch we move the logic into a
separate AA which helps with the growing complexity and use cases. We
also extend the interface to answer the second question rather than the
first. So we do not determine dynamically uniqueness but if we might end
up with the `llvm::Value` describing a different dynamic instance. Note
that the latter is very much tied to the Attributor capabilities to look
through memory, recursion, etc. so we need to update the logic as we go.
DeltaFile
+160-116llvm/test/Transforms/OpenMP/parallel_region_merging.ll
+173-6llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+44-1llvm/include/llvm/Transforms/IPO/Attributor.h
+16-8llvm/test/Transforms/Attributor/ArgumentPromotion/alloca-as.ll
+6-16llvm/lib/Transforms/IPO/Attributor.cpp
+8-8llvm/test/Transforms/Attributor/callbacks.ll
+407-1555 files not shown
+415-17211 files

LLVM/project 857bf30llvm/lib/Transforms/IPO AttributorAttributes.cpp, llvm/test/Transforms/Attributor value-simplify-pointer-info.ll value-simplify.ll

[Attributor] Remove broken and duplicated load simplification

We look through loads in the "generic value traversal" and we
consequently don't need to look through them again in AAValueSimplify*.
The test changes stem from the fact that we allowed any simplified
value, incl. non-dynamically unique ones, as long as the underlying
memory was an alloca. This doesn't seem to make sense as allocas do not
protect against dynamically non-unique values. We need to make the
unique check better rather than excluding allocas. That in mind, we can
remove a lot of code by simply relying on the generic value traversal
load look through.

To soften the blow some minor adjustments have been made that allow more
simplification through the now used scheme and some tests have been
given a `norecurse` for now.
DeltaFile
+379-303llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+116-160llvm/test/Transforms/OpenMP/parallel_region_merging.ll
+0-109llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+8-16llvm/test/Transforms/Attributor/ArgumentPromotion/alloca-as.ll
+10-10llvm/test/Transforms/Attributor/value-simplify.ll
+8-8llvm/test/Transforms/Attributor/callbacks.ll
+521-6065 files not shown
+540-61711 files

LLVM/project 80a0c15clang/test/CodeGen/RISCV/rvv-intrinsics vluxseg.c vloxseg.c, clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded vluxseg.c vloxseg.c

Merge branch 'main' into irbuilder-extract-refactor
DeltaFile
+12,242-14,649llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-global.mir
+11,615-13,961llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-local.mir
+2-24,936clang/test/CodeGen/RISCV/rvv-intrinsics/vluxseg.c
+2-24,936clang/test/CodeGen/RISCV/rvv-intrinsics/vloxseg.c
+2-21,307clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/vluxseg.c
+2-21,307clang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/vloxseg.c
+23,865-121,09630,598 files not shown
+2,090,526-1,305,42030,604 files

LLVM/project d1186cellvm/test/Transforms/Attributor internal-noalias.ll openmp_parallel.ll, llvm/test/Transforms/Attributor/ArgumentPromotion alignment.ll basictest.ll

[Attributor] Make interprocedural value explicit in genericValueTraversal

genericValueTraversal can look through arguments and allow value
simplification across function boundaries. In fact, the latter already
happened unchecked. With this change we allow the user of
genericValueTraversal to opt-out of interprocedural traversal if
required. We explicitly look through arguments now which helps to do
various things, incl. the propagation of constants into OpenMP parallel
regions (on the host).
DeltaFile
+244-130llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll
+62-162llvm/test/Transforms/Attributor/internal-noalias.ll
+39-180llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll
+23-116llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll
+64-74llvm/test/Transforms/Attributor/openmp_parallel.ll
+50-80llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+482-74222 files not shown
+738-1,10428 files

LLVM/project 0539246llvm/lib/CodeGen SafeStack.cpp, llvm/test/CodeGen/MIR/X86 load-with-1gb-alignment.mir load-with-max-alignment.mir

Reland [IR] Increase max alignment to 4GB

Currently the max alignment representable is 1GB, see D108661.
Setting the align of an object to 4GB is desirable in some cases to make sure the lower 32 bits are clear which can be used for some optimizations, e.g. https://crbug.com/1016945.

This uses an extra bit in instructions that carry an alignment. We can store 15 bits of "free" information, and with this change some instructions (e.g. AtomicCmpXchgInst) use 14 bits.
We can increase the max alignment representable above 4GB (up to 2^62) since we're only using 33 of the 64 values, but I've just limited it to 4GB for now.

The one place we have to update the bitcode format is for the alloca instruction. It stores its alignment into 5 bits of a 32 bit bitfield. I've added another field which is 8 bits and should be future proof for a while. For backward compatibility, we check if the old field has a value and use that, otherwise use the new field.

Updating clang's max allowed alignment will come in a future patch.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D110451
DeltaFile
+0-44llvm/test/CodeGen/MIR/X86/load-with-1gb-alignment.mir
+44-0llvm/test/CodeGen/MIR/X86/load-with-max-alignment.mir
+20-20llvm/test/Transforms/Attributor/callbacks.ll
+12-12llvm/test/Transforms/InstCombine/atomic.ll
+12-11llvm/lib/CodeGen/SafeStack.cpp
+10-10llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll
+98-9754 files not shown
+236-22460 files

LLVM/project 569346fllvm/test/CodeGen/MIR/X86 load-with-max-alignment.mir load-with-1gb-alignment.mir, llvm/test/Transforms/Attributor callbacks.ll value-simplify.ll

Revert "Reland [IR] Increase max alignment to 4GB"

This reverts commit 8d64314ffea55f2ad94c1b489586daa8ce30f451.
DeltaFile
+0-44llvm/test/CodeGen/MIR/X86/load-with-max-alignment.mir
+44-0llvm/test/CodeGen/MIR/X86/load-with-1gb-alignment.mir
+20-20llvm/test/Transforms/Attributor/callbacks.ll
+12-12llvm/test/Transforms/InstCombine/atomic.ll
+10-10llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll
+8-8llvm/test/Transforms/Attributor/value-simplify.ll
+94-9450 files not shown
+210-21956 files