[all-commits] [llvm/llvm-project] f3cfaf: [MemoryBuiltins][FIX] Adjust index type size prope...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Mon Feb 21 13:51:10 PST 2022


  Branch: refs/heads/release/14.x
  Home:   https://github.com/llvm/llvm-project
  Commit: f3cfaf8bc8eb772417294c2d3c847cd750337224
      https://github.com/llvm/llvm-project/commit/f3cfaf8bc8eb772417294c2d3c847cd750337224
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-02-21 (Mon, 21 Feb 2022)

  Changed paths:
    M llvm/include/llvm/Analysis/MemoryBuiltins.h
    M llvm/lib/Analysis/MemoryBuiltins.cpp
    M llvm/test/Transforms/InstCombine/builtin-dynamic-object-size.ll

  Log Message:
  -----------
  [MemoryBuiltins][FIX] Adjust index type size properly wrt. AS casts

Use existing functionality to strip constant offsets that works well
with AS casts and avoids the code duplication.

Since we strip AS casts during the computation of the offset we also
need to adjust the APInt properly to avoid mismatches in the bit width.
This code ensures the caller of `compute` sees APInts that match the
index type size of the value passed to `compute`, not the value result
of the strip pointer cast.

Fixes #53559.

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

(cherry picked from commit 29c8ebad10b4c349a185438fed52e08426d603e1)


  Commit: 13fdc7afa8565810fb28793bd60b9a5cf8d0d978
      https://github.com/llvm/llvm-project/commit/13fdc7afa8565810fb28793bd60b9a5cf8d0d978
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-02-21 (Mon, 21 Feb 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    M llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll
    M llvm/test/Transforms/Attributor/align.ll
    M llvm/test/Transforms/Attributor/internal-noalias.ll
    M llvm/test/Transforms/Attributor/liveness.ll
    M llvm/test/Transforms/Attributor/liveness_chains.ll
    M llvm/test/Transforms/Attributor/memory_locations.ll
    M llvm/test/Transforms/Attributor/noalias.ll
    M llvm/test/Transforms/Attributor/nocapture-2.ll
    M llvm/test/Transforms/Attributor/nodelete.ll
    M llvm/test/Transforms/Attributor/nofree.ll
    M llvm/test/Transforms/Attributor/nonnull.ll
    M llvm/test/Transforms/Attributor/norecurse.ll
    M llvm/test/Transforms/Attributor/noreturn.ll
    M llvm/test/Transforms/Attributor/nosync.ll
    M llvm/test/Transforms/Attributor/nounwind.ll
    M llvm/test/Transforms/Attributor/potential.ll
    M llvm/test/Transforms/Attributor/range.ll
    M llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll
    M llvm/test/Transforms/Attributor/returned.ll
    M llvm/test/Transforms/Attributor/value-simplify-gpu.ll
    M llvm/test/Transforms/Attributor/value-simplify-instances.ll
    M llvm/test/Transforms/Attributor/willreturn.ll
    M llvm/test/Transforms/OpenMP/remove_globalization.ll

  Log Message:
  -----------
  [Attributor][FIX] Reachability needs to account for readonly callees

The oversight caused us to ignore call sites that are effectively dead
when we computed reachability (or more precise the call edges of a
function). The problem is that loads in the readonly callee might depend
on stores prior to the callee. If we do not track the call edge we
mistakenly assumed the store before the call cannot reach the load.
The problem is nicely visible in:
  `llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll`

Caused by D118673.

Fixes https://github.com/llvm/llvm-project/issues/53726


  Commit: fef110bf8b2b3017b92c61de27ed5cd034b6b0e2
      https://github.com/llvm/llvm-project/commit/fef110bf8b2b3017b92c61de27ed5cd034b6b0e2
  Author: Brad Smith <brad at comstyle.com>
  Date:   2022-02-21 (Mon, 21 Feb 2022)

  Changed paths:
    M clang-tools-extra/clangd/unittests/SerializationTests.cpp

  Log Message:
  -----------
  [clangd] Fix building SerializationTests unit test on OpenBSD

This fixes building the unit tests on OpenBSD. OpenBSD does not support RLIMIT_AS.

Reviewed By: kadircet

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

(cherry picked from commit f374c8ddf2dd4920190cac0ea81e18a74040ddda)


  Commit: 56ac6dbc736904c3e812c575853e1e683aa0ed6a
      https://github.com/llvm/llvm-project/commit/56ac6dbc736904c3e812c575853e1e683aa0ed6a
  Author: Brad Smith <brad at comstyle.com>
  Date:   2022-02-21 (Mon, 21 Feb 2022)

  Changed paths:
    M llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp

  Log Message:
  -----------
  [RuntimeDyld] Fix building on OpenBSD

With https://reviews.llvm.org/D105466 the tree does not build on OpenBSD/amd64.
Moritz suggested only building this code on Linux.

Reviewed By: MoritzS

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

(cherry picked from commit 7db1d4d8da4d4dfc5d0240825e8c4d536a12b19c)


  Commit: 9bf8897c84f797c98ec4c2e1475f5f1539f8277b
      https://github.com/llvm/llvm-project/commit/9bf8897c84f797c98ec4c2e1475f5f1539f8277b
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-02-21 (Mon, 21 Feb 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/OpenMPOpt.cpp
    M llvm/test/Transforms/OpenMP/get_hardware_num_threads_in_block_fold.ll

  Log Message:
  -----------
  [OpenMP] Add RTL function to externalization RAII

This patch adds the '_kmpc_get_hardware_num_threads_in_block'
OpenMP RTL function to the externalization RAII struct. This was getting
optimized out and then being replaced with an undefined value once added
back in, causing bugs for complex reductions.

Fixes #53909.

Reviewed By: jdoerfert

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

(cherry picked from commit 74cacf212bb31f8ba837b7eb2434258dd79eaccb)


  Commit: b3d3501aa128e7c2cb715319918c0ca66384d3cc
      https://github.com/llvm/llvm-project/commit/b3d3501aa128e7c2cb715319918c0ca66384d3cc
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-02-21 (Mon, 21 Feb 2022)

  Changed paths:
    M openmp/libomptarget/DeviceRTL/include/Mapping.h
    M openmp/libomptarget/DeviceRTL/src/Kernel.cpp
    M openmp/libomptarget/DeviceRTL/src/Mapping.cpp
    M openmp/libomptarget/DeviceRTL/src/State.cpp

  Log Message:
  -----------
  [OpenMP][FIX] Eliminate race on the IsSPMD global

The `IsSPMD` global can only be read by threads other than the main
thread *after* initialization is complete. To allow usage of
`mapping::getBlockSize` before initialization is done, we can pass the
`IsSPMD` state explicitly. This is similar to other APIs that take
`IsSPMD` explicitly to avoid such a race, e.g.,
`mapping::isInitialThreadInLevel0(IsSPMD)`

Fixes https://github.com/llvm/llvm-project/issues/53857

(cherry picked from commit 57b4c5267b7293b1990d8418477b24732ba0468b)


  Commit: 5593af72d0c53aa0f1ec1653f5bcfaaf1baeec5f
      https://github.com/llvm/llvm-project/commit/5593af72d0c53aa0f1ec1653f5bcfaaf1baeec5f
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-02-21 (Mon, 21 Feb 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    M llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll
    M llvm/test/Transforms/OpenMP/spmdization.ll

  Log Message:
  -----------
  [Attributor][FIX] Heap2Stack needs to use the alloca AS

When we move an allocation from the heap to the stack we need to
allocate it in the alloca AS and then cast the result. This also
prevents us from inserting the alloca after the allocation call but
rather right before.

Fixes https://github.com/llvm/llvm-project/issues/53858

(cherry picked from commit 8ad39fbaf23893b3384cafa0f179d35dcf3c672b)


Compare: https://github.com/llvm/llvm-project/compare/c06cc1c3a7f8...5593af72d0c5


More information about the All-commits mailing list