[all-commits] [llvm/llvm-project] 9ed930: [MC][test] Improve offset.s

Florian Hahn via All-commits all-commits at lists.llvm.org
Wed May 11 14:46:04 PDT 2022


  Branch: refs/heads/release/14.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 9ed930e5cd74011f6d236d6a653138d076a5320f
      https://github.com/llvm/llvm-project/commit/9ed930e5cd74011f6d236d6a653138d076a5320f
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-05-11 (Wed, 11 May 2022)

  Changed paths:
    M llvm/test/MC/ELF/offset.s

  Log Message:
  -----------
  [MC][test] Improve offset.s

(cherry picked from commit 67acc34e2ad89f18a6d66d72ddc30e77c5aff7d9)


  Commit: f3f90ec42ae674afe1858b4f7d9f270731872b80
      https://github.com/llvm/llvm-project/commit/f3f90ec42ae674afe1858b4f7d9f270731872b80
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-05-11 (Wed, 11 May 2022)

  Changed paths:
    M llvm/lib/MC/ELFObjectWriter.cpp
    M llvm/test/MC/ELF/offset.s

  Log Message:
  -----------
  [MC][ELF] Improve st_size propagation rule

`.symver foo, foo at ver` creates the MCSymbolELF `foo at ver` whose almost all
attributes (including st_size) should inherit from `foo` (GNU as behavior).

a041ef1bd8905f0d58e301c6830b183002ff1847 added st_size propagation which works
for many cases but fails for the following one:

```
.set __GLIBC_2_12_sys_errlist, _sys_errlist_internal
.type   __GLIBC_2_12_sys_errlist, at object
.size   __GLIBC_2_12_sys_errlist, 1080
.symver __GLIBC_2_12_sys_errlist, sys_errlist at GLIBC_2.12
...
_sys_errlist_internal:
.size   _sys_errlist_internal, 1072
```

`sys_errlist at GLIBC_2.12`'s st_size is 1072 (incorrect), which does not match
`__GLIBC_2_12_sys_errlist`'s st_size: 1080.

The problem is that `Base` is (the final) `_sys_errlist_internal` while we want
to respect (the intermediate) `__GLIBC_2_12_sys_errlist`'s st_size.
Fix this by following the MCSymbolRefExpr assignment chain and finding
the closest non-null `getSize()`, which covers most needs. Notably MCBinaryExpr
is not handled, but it is rare enough to matter.

Reviewed By: peter.smith

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

(cherry picked from commit e07dfa5328b0ca1465ae7b749e1ac2d994741e27)


  Commit: 5c4cf01f47da35816a252c4656b36404b4b8615c
      https://github.com/llvm/llvm-project/commit/5c4cf01f47da35816a252c4656b36404b4b8615c
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-05-11 (Wed, 11 May 2022)

  Changed paths:
    M clang/lib/Driver/ToolChains/Linux.cpp
    M clang/test/Driver/linux-ld.c

  Log Message:
  -----------
  [Driver][Linux] Remove D.Dir+"/../lib" from default search paths for LLVM_ENABLE_RUNTIMES builds

The rule was added in 2014 to support -stdlib=libc++ and -lc++ without
specifying -L, when D.Dir is not a well-known system library directory like
/usr/lib /usr/lib64. This rule turns out to get in the way with (-m32 for
64-bit clang) or (-m64 for 32-bit clang) for Gentoo :
https://github.com/llvm/llvm-project/issues/54515

Nowadays LLVM_ENABLE_RUNTIMES is the only recommended way building libc++ and
LLVM_ENABLE_PROJECTS=libc++ is deprecated. LLVM_ENABLE_RUNTIMES builds libc++
in D.Dir+"/../lib/${triple}/". The rule is unneeded. Also reverts D108286.

Gentoo uses a modified LLVM_ENABLE_RUNTIMES that installs libc++.so in
well-known paths like /usr/lib64 and /usr/lib which are already covered by
nearby search paths.

Implication: if a downstream package needs something like -lLLVM-15git and uses
libLLVM-15git.so not in a well-known path, it needs to supply -L
D.Dir+"/../lib" explicitly (e.g. via LLVMConfig.cmake), instead of relying on
the previous default search path.

Reviewed By: mgorny

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

(cherry picked from commit afaefb671fe12e7788d3e8de6b6193b935fbf16c)


  Commit: 869c1d7d09025ae6a30acd9423eb3febd96a143c
      https://github.com/llvm/llvm-project/commit/869c1d7d09025ae6a30acd9423eb3febd96a143c
  Author: Mark Kettenis <mark.kettenis at xs4all.nl>
  Date:   2022-05-11 (Wed, 11 May 2022)

  Changed paths:
    M clang/lib/Basic/TargetInfo.cpp
    M clang/test/Preprocessor/init-arm.c
    M clang/test/Preprocessor/init-ppc.c
    M clang/test/Preprocessor/init-x86.c

  Log Message:
  -----------
  [Clang] Fix the guaranteed alignment of memory returned by malloc/new on OpenBSD

The guaranteed alignment is 16 bytes on OpenBSD.

(cherry picked from commit c7ee0b8bda8b32a800bc01e9151b364446a6e1b1)


  Commit: 50d4a84152c67ee16b2e54ddca4f6cca32890bb5
      https://github.com/llvm/llvm-project/commit/50d4a84152c67ee16b2e54ddca4f6cca32890bb5
  Author: Brad Smith <brad at comstyle.com>
  Date:   2022-05-11 (Wed, 11 May 2022)

  Changed paths:
    M clang/test/Preprocessor/init.c

  Log Message:
  -----------
  Fix test for c7ee0b8bda8b32a800bc01e9151b364446a6e1b1

OpenBSD/sparc is dead and support was removed awhile ago.

(cherry picked from commit 7898c79b742f0dda6ec47b572f727fcd6d8ff54a)


  Commit: cd597588217a69b413ad44ba11d650b576045e2b
      https://github.com/llvm/llvm-project/commit/cd597588217a69b413ad44ba11d650b576045e2b
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2022-05-11 (Wed, 11 May 2022)

  Changed paths:
    M clang/lib/Driver/ToolChains/AMDGPU.cpp
    M clang/test/Driver/hip-include-path.hip
    M clang/test/Driver/rocm-detect.hip

  Log Message:
  -----------
  [HIP] Fix HIP include path

The clang compiler prepends the HIP header include paths to the search
list using -internal-isystem when building for the HIP language. This
prevents warnings related to things like reserved identifiers when
including the HIP headers even when ROCm is installed in a non-system
directory, such as /opt/rocm.

However, when HIP is installed in /usr, then the prepended include
path would be /usr/include. That is a problem, because the C standard
library headers are stored in /usr/include and the C++ standard
library headers must come before the C library headers in the search
path list (because the C++ standard library headers use #include_next
to include the C standard library headers).

While the HIP wrapper headers _do_ need to be earlier in the search
than the C++ headers, those headers get their own subdirectory and
their own explicit -internal-isystem argument. This include path is for
<hip/hip_runtime_api.h> and <hip/hip_runtime.h>, which do not require a
particular search ordering with respect to the C or C++ headers. Thus,
HIP include path is added after other system include paths.

With contribution from Cordell Bloor.

Reviewed by: Artem Belevich

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

(cherry picked from commit 6730b44480fcce18bfbbae0c46719250e9eae425)


  Commit: 39e909731a11f14006b347a1510ab3b9a93c2c70
      https://github.com/llvm/llvm-project/commit/39e909731a11f14006b347a1510ab3b9a93c2c70
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-05-11 (Wed, 11 May 2022)

  Changed paths:
    M llvm/test/Transforms/InstCombine/logical-select.ll

  Log Message:
  -----------
  [InstCombine] add scalable vector test for logical select; NFC

D124997 shows that the code is not ready to handle scalable vectors,
so add some more coverage for a potential crashing case.

(cherry picked from commit 7bad1d281c798929ae1be44b8c8a1e0713151ea9)


  Commit: 0108630f8bc5d520400247d7834a11de4e2b62fa
      https://github.com/llvm/llvm-project/commit/0108630f8bc5d520400247d7834a11de4e2b62fa
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2022-05-11 (Wed, 11 May 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/test/Transforms/InstCombine/logical-select.ll

  Log Message:
  -----------
  [InstCombine] Fix scalable-vector bitwise select matching

D113035 enhanced the matching of bitwise selects from vector types. This
change unfortunately introduced crashes as it tries to cast scalable
vector types to integers.

Reviewed By: spatel

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

(cherry picked from commit bafab9c09f68190d1928a341255d50a7732443ab)


  Commit: 60c8e02c9d12b38c00e5f870d883c5ac293a5371
      https://github.com/llvm/llvm-project/commit/60c8e02c9d12b38c00e5f870d883c5ac293a5371
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2022-05-11 (Wed, 11 May 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/SCCP.cpp
    M llvm/test/Transforms/SCCP/switch-constantfold-crash.ll

  Log Message:
  -----------
  [IPSCCP] Support unfeasible default dests for switch.

At the moment, unfeasible default destinations are not handled properly
in removeNonFeasibleEdges. So far, only unfeasible cases are removed,
but later code expects unreachable blocks to have no predecessors.

This is causing the crash reported in PR49573.

If the default destination is unfeasible it won't be executed. Create
a new unreachable block on demand and use that as default
destination.

Note that at the moment this only is relevant for cases where
resolvedUndefsIn marks the first case as executable. Regular switch
handling has a FIXME/TODO to support determining whether the default
case is feasible or not.

Fixes #48917.

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

(cherry picked from commit 857c612d899f271402470d4026d2e3be1dce53a4)


Compare: https://github.com/llvm/llvm-project/compare/5eb22621bcd2...60c8e02c9d12


More information about the All-commits mailing list