[all-commits] [llvm/llvm-project] ee75c7: [Attributor][FIX] Honor alloca address space in AA...

Balazs Benics via All-commits all-commits at lists.llvm.org
Mon Feb 14 14:15:36 PST 2022


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

  Changed paths:
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    A llvm/test/Transforms/Attributor/ArgumentPromotion/alloca-as.ll

  Log Message:
  -----------
  [Attributor][FIX] Honor alloca address space in AAPrivatizablePtr

When we privatize a pointer (~argument promotion) we introduce new
private allocas as replacement. These need to be placed in the alloca
address space as later passes cannot properly deal with them otherwise.

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

(cherry picked from commit e39b41931264d9f774dbe151bb64f4b579cf1ee0)


  Commit: 66c59c0e5bb7b0e89dc9e77a36be09c7f3cc8f5c
      https://github.com/llvm/llvm-project/commit/66c59c0e5bb7b0e89dc9e77a36be09c7f3cc8f5c
  Author: Reid Kleckner <rnk at google.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M llvm/lib/Target/X86/X86FrameLowering.cpp
    M llvm/test/CodeGen/X86/x86-64-flags-intrinsics.ll
    M llvm/test/CodeGen/X86/x86-flags-intrinsics.ll

  Log Message:
  -----------
  [X86] Only force FP usage in the presence of pushf/popf on Win64

This ensures that the Windows unwinder will work at every instruction
boundary, and allows other targets to read and write flags without
setting up a frame pointer.

Fixes GH-46875

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

(cherry picked from commit f3481f43bbe2c8a24e74210d310cf3be291bf52d)


  Commit: 92f6212d3cdbb13557520c5b7172e251f8736c52
      https://github.com/llvm/llvm-project/commit/92f6212d3cdbb13557520c5b7172e251f8736c52
  Author: Amy Kwan <amy.kwan1 at ibm.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M llvm/utils/release/test-release.sh

  Log Message:
  -----------
  [test-release.sh] Add option to disable building clang-tools-extra during release testing.

This patch adds an option (no-clang-tools) to disable building clang-tools-extra when
performing release testing. Prior to this patch, clang-tools-extra was built by default,
but on some platforms (such as AIX), clang-tools-extra is not supported, and so we do
not normally build it. Furthermore, this change should not change the invocation for
targets that build clang-tools-extra normally.

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

(cherry picked from commit db691903d268d6d56f8a028de85aa2fc0c7d48e9)


  Commit: ae88d8844673fbe7a2b7550a8cd168c7bebca99d
      https://github.com/llvm/llvm-project/commit/ae88d8844673fbe7a2b7550a8cd168c7bebca99d
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M llvm/include/llvm/CodeGen/TargetLowering.h
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Target/X86/X86ISelLowering.h

  Log Message:
  -----------
  [SDAG] move x86 select-with-identity-constant fold behind a target hook; NFC

This is no-functional-change-intended because only the
x86 target enables the TLI hook currently.

We can add fmul/fdiv opcodes to the switch similar to the
proposal D119111, but we don't need to make other changes
like enabling target-specific combines.

We can also add integer opcodes (add, or, shl, etc.) to
the switch because this function is called from all of the
generic binary opcodes.

The goal is to incrementally enable the profitable diffs
from D90113 while avoiding regressions.

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

(cherry picked from commit a68e098024708cba7b37d6c5a27a4003e8944142)


  Commit: a42f1f88f1361bd010fbec932d70f698853488ec
      https://github.com/llvm/llvm-project/commit/a42f1f88f1361bd010fbec932d70f698853488ec
  Author: Jameson Nash <vtjnash at gmail.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M clang-tools-extra/test/CMakeLists.txt
    M clang-tools-extra/test/lit.site.cfg.py.in
    M clang/CMakeLists.txt
    M clang/examples/AnnotateFunctions/CMakeLists.txt
    M clang/examples/Attribute/CMakeLists.txt
    M clang/examples/CallSuperAttribute/CMakeLists.txt
    M clang/examples/PluginsOrder/CMakeLists.txt
    M clang/examples/PrintFunctionNames/CMakeLists.txt
    M clang/lib/Analysis/plugins/CMakeLists.txt
    M clang/test/CMakeLists.txt
    M clang/test/lit.site.cfg.py.in
    M clang/tools/driver/CMakeLists.txt

  Log Message:
  -----------
  replace clang LLVM_ENABLE_PLUGINS -> CLANG_PLUGIN_SUPPORT in tests

Ensure CLANG_PLUGIN_SUPPORT is compatible with llvm_add_library.
Fixes an issue noted in D111100.

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

(cherry picked from commit 76cad51ba700233d6e3492eddcbb466b6adbc2eb)


  Commit: 67e0b64c0e6c769126b354b39bc5fa3f5d9d73d1
      https://github.com/llvm/llvm-project/commit/67e0b64c0e6c769126b354b39bc5fa3f5d9d73d1
  Author: Marek Kurdej <marek.kurdej+llvm.org at gmail.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M clang/lib/Format/QualifierAlignmentFixer.cpp
    M clang/unittests/Format/QualifierFixerTest.cpp

  Log Message:
  -----------
  [clang-format] Honour "// clang-format off" when using QualifierOrder.

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

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan

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

(cherry picked from commit e329b5866f1732f5c24cf2ae96479971f7101914)


  Commit: 8b3ba440a2f0e7539574395d9bed209646d341e4
      https://github.com/llvm/llvm-project/commit/8b3ba440a2f0e7539574395d9bed209646d341e4
  Author: Sven van Haastregt <sven.vanhaastregt at arm.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl

  Log Message:
  -----------
  [OpenCL] Test -fdeclare-opencl-builtins with CL3 and CLC++2021

But only test in combination with -finclude-default-header, as the
headerless tests may be dropped soon.

(cherry picked from commit e0e6f3a6a2e13ee11b014ca45a48997e78d3efc5)


  Commit: 174dffbae24fbad842603c1d32d3c70c0b9783ae
      https://github.com/llvm/llvm-project/commit/174dffbae24fbad842603c1d32d3c70c0b9783ae
  Author: Sven van Haastregt <sven.vanhaastregt at arm.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M clang/lib/Sema/OpenCLBuiltins.td

  Log Message:
  -----------
  [OpenCL] Move most _explicit atomics into multiclass; NFC

This will simplify future conditionalization for OpenCL 3.0
optionality of atomic features.

The only set of atomic functions not using the multiclass is
atomic_compare_exchange_strong/weak, as these don't fit the common
pattern due to having 2 MemoryOrder arguments.

(cherry picked from commit d97a4dfea6c2781494f6fe54ce265128f5c08dc2)


  Commit: 865a18c94d50b6bd79c31e05a5c142846182c998
      https://github.com/llvm/llvm-project/commit/865a18c94d50b6bd79c31e05a5c142846182c998
  Author: Sven van Haastregt <sven.vanhaastregt at arm.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M clang/lib/Sema/OpenCLBuiltins.td

  Log Message:
  -----------
  [OpenCL] Move OpenCL 2.0 atomics into multiclass; NFC

This is in preparation for adding the OpenCL 3.0 builtins with named
address space arguments.

(cherry picked from commit 31fa3a4d44316fd36e11f92729ea9596ee3bf3f8)


  Commit: 84260978cbf52485d9347e20386fda6bb82df763
      https://github.com/llvm/llvm-project/commit/84260978cbf52485d9347e20386fda6bb82df763
  Author: Sven van Haastregt <sven.vanhaastregt at arm.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M clang/lib/Sema/OpenCLBuiltins.td

  Log Message:
  -----------
  [OpenCL] Fix atomic_fetch_add/sub with half type

An error in the tablegen description affects the declarations
provided by `-fdeclare-opencl-builtins` for `atomic_fetch_add` and
`atomic_fetch_sub`.

The atomic argument should be an atomic_half, not an atomic_float.

(cherry picked from commit fe690587bedb23dec2753549d4216059a7f894a1)


  Commit: f4c48b2015cb3045962695b6e9e9fa7545b2895b
      https://github.com/llvm/llvm-project/commit/f4c48b2015cb3045962695b6e9e9fa7545b2895b
  Author: Sven van Haastregt <sven.vanhaastregt at arm.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M clang/lib/Sema/OpenCLBuiltins.td

  Log Message:
  -----------
  [OpenCL] Refactor cl_ext_float_atomics declarations; NFC

Reduce the amount of repetition in the declarations by leveraging more
TableGen constructs.  This is in preparation for adding the OpenCL 3.0
atomics feature optionality.

(cherry picked from commit 8d37043520f57e63e032c9d0ba4cba8701a3cd35)


  Commit: fa24d7e3e0ea67d53b7057e07d5bc7e75ffda9ba
      https://github.com/llvm/llvm-project/commit/fa24d7e3e0ea67d53b7057e07d5bc7e75ffda9ba
  Author: Sven van Haastregt <sven.vanhaastregt at arm.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M clang/lib/Headers/opencl-c-base.h
    M clang/lib/Sema/OpenCLBuiltins.td
    M clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl

  Log Message:
  -----------
  [OpenCL] Add OpenCL 3.0 atomics to -fdeclare-opencl-builtins

Add the atomic overloads for the `global` and `local` address spaces,
which are new in OpenCL 3.0.  Ensure the preexisting `generic`
overloads are guarded by the generic address space feature macro.

Ensure a subset of the atomic builtins are guarded by the
`__opencl_c_atomic_order_seq_cst` and `__opencl_c_atomic_scope_device`
feature macros, and enable those macros for SPIR/SPIR-V targets in
`opencl-c-base.h`.

Also guard the `cl_ext_float_atomics` builtins with the atomic order
and scope feature macros.

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

(cherry picked from commit 50f8abb9f40a6c4974ec71e760773a711732648f)


  Commit: 95dd9c5f2a0642260c5351d860757c4b8abe4537
      https://github.com/llvm/llvm-project/commit/95dd9c5f2a0642260c5351d860757c4b8abe4537
  Author: Anton Zabaznov <anton.zabaznov at intel.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M clang/include/clang/Basic/Builtins.def
    M clang/include/clang/Basic/Builtins.h
    M clang/lib/Basic/Builtins.cpp
    M clang/test/CodeGenOpenCL/cl20-device-side-enqueue.cl
    M clang/test/CodeGenOpenCL/pipe_types.cl
    M clang/test/CodeGenOpenCL/to_addr_builtin.cl
    M clang/test/SemaOpenCL/cl20-device-side-enqueue.cl
    M clang/test/SemaOpenCL/clang-builtin-version.cl
    M clang/test/SemaOpenCL/to_addr_builtin.cl

  Log Message:
  -----------
  [OpenCL] Add support of language builtins for OpenCL C 3.0

OpenCL C 3.0 introduces optionality to some builtins, in particularly
to those which are conditionally supported with pipe, device enqueue
and generic address space features.

The idea is to conditionally support such builtins depending on the language options
being set for a certain feature. This allows users to define functions with names
of those optional builtins in OpenCL (as such names are not reserved).

Reviewed By: Anastasia

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

(cherry picked from commit bee4bd70f76952b2c6296feb46a087b497322376)


  Commit: 7bb1dfeeba8779ab9740cf05f01198ed7ce41277
      https://github.com/llvm/llvm-project/commit/7bb1dfeeba8779ab9740cf05f01198ed7ce41277
  Author: Anton Zabaznov <anton.zabaznov at intel.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/SemaOpenCL/cl20-device-side-enqueue.cl

  Log Message:
  -----------
  [OpenCL] Adjust diagnostic for subgroup support.

OpenCL C 3.0 __opencl_c_subgroups feature is slightly different
then other equivalent features and extensions (fp64 and 3d image writes):
OpenCL C 3.0 device can support the extension but not the feature.
cl_khr_subgroups requires subgroup independent forward progress.

This patch adjusts the check which is used when translating language
builtins to check either the extension or feature is supported.

Reviewed By: Anastasia

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

(cherry picked from commit bfb1a33bec7c88170b0809b8a7c9cb860e7cc19b)


  Commit: 200390c3c17196b9c0f34453eeb85175015b2283
      https://github.com/llvm/llvm-project/commit/200390c3c17196b9c0f34453eeb85175015b2283
  Author: Martin Storsjö <martin at martin.st>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M clang/lib/Driver/ToolChains/MinGW.cpp
    M clang/test/Driver/mingw-msvcrt.c

  Log Message:
  -----------
  [clang] [MinGW] Recognize -lcrtdll as a library replacing -lmsvcrt

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

(cherry picked from commit 079b6d02d1f52301e2d3276fadba822bf87b75b2)


  Commit: b9f51faa087ae639ea231a86d3210b96accf0306
      https://github.com/llvm/llvm-project/commit/b9f51faa087ae639ea231a86d3210b96accf0306
  Author: Amy Kwan <amy.kwan1 at ibm.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M llvm/utils/release/test-release.sh

  Log Message:
  -----------
  [test-release.sh] Set TEST_SUITE_HOST_CC to the release testing build compiler when compiling test-suite tools.

The tools used by test-suite are originally configured to compile with cc by
default, and this is dictated by TEST_SUITE_HOST_CC.
However, it is possible that on some systems that the version of cc may either
not be present or it may not be able to compile the tools as it may be too old,
which could be an issue seen during release testing.

This patch updates the compiler to be the default build compiler that is used
for release testing. If no such compiler it specified, then cc will be set as
the test-suite tools build compiler by default (as it already is set under
TEST_SUITE_HOST_CC).

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

(cherry picked from commit 413b35cd74e42f6371641bc9dc6c707aedac82ff)


  Commit: 9fa896f9e48f54efce4a44bd5e1310b442283da7
      https://github.com/llvm/llvm-project/commit/9fa896f9e48f54efce4a44bd5e1310b442283da7
  Author: Balazs Benics <balazs.benics at sigmatechnology.se>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M clang/tools/scan-build-py/lib/libear/ear.c

  Log Message:
  -----------
  [scan-build] Fix deadlock at failures in libears/ear.c

We experienced some deadlocks when we used multiple threads for logging
using `scan-builds` intercept-build tool when we used multiple threads by
e.g. logging `make -j16`

```
(gdb) bt
#0  0x00007f2bb3aff110 in __lll_lock_wait () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007f2bb3af70a3 in pthread_mutex_lock () from /lib/x86_64-linux-gnu/libpthread.so.0
#2  0x00007f2bb3d152e4 in ?? ()
#3  0x00007ffcc5f0cc80 in ?? ()
#4  0x00007f2bb3d2bf5b in ?? () from /lib64/ld-linux-x86-64.so.2
#5  0x00007f2bb3b5da27 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#6  0x00007f2bb3b5dbe0 in exit () from /lib/x86_64-linux-gnu/libc.so.6
#7  0x00007f2bb3d144ee in ?? ()
#8  0x746e692f706d742f in ?? ()
#9  0x692d747065637265 in ?? ()
#10 0x2f653631326b3034 in ?? ()
#11 0x646d632e35353532 in ?? ()
#12 0x0000000000000000 in ?? ()
```

I think the gcc's exit call caused the injected `libear.so` to be unloaded
by the `ld`, which in turn called the `void on_unload() __attribute__((destructor))`.
That tried to acquire an already locked mutex which was left locked in the
`bear_report_call()` call, that probably encountered some error and
returned early when it forgot to unlock the mutex.

All of these are speculation since from the backtrace I could not verify
if frames 2 and 3 are in fact corresponding to the `libear.so` module.
But I think it's a fairly safe bet.

So, hereby I'm releasing the held mutex on *all paths*, even if some failure
happens.

PS: I would use lock_guards, but it's C.

Reviewed-by: NoQ

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

(cherry picked from commit d919d027ba2a41df5d51ce82ae7f2fb64d2cba41)


Compare: https://github.com/llvm/llvm-project/compare/4384a21fdcaa...9fa896f9e48f


More information about the All-commits mailing list