[all-commits] [llvm/llvm-project] 61c8cf: [Attributor][FIX] Do not use assumed information f...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Tue Feb 8 21:27:52 PST 2022


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

  Changed paths:
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    M llvm/test/Transforms/Attributor/undefined_behavior.ll

  Log Message:
  -----------
  [Attributor][FIX] Do not use assumed information for UB detection

The helper `Attributor::checkForAllReturnedValuesAndReturnInsts`
simplifies the returned value optimistically. In `AAUndefinedBehavior`
we cannot use such optimistic values when deducing UB. As a result, we
assumed UB for the return value of a function because we initially
(=optimistically) thought the function return is `undef`. While we later
adjusted this properly, the `AAUndefinedBehavior` was under the
impression the return value is "known" (=fix) and could never change.

To correct this we use `Attributor::checkForAllInstructions` and then
manually to perform simplification of the return value, only allowing
known values to be used. This actually matches the other UB deductions.

Fixes #53647

(cherry picked from commit dd101c808b85aad8edb48ab6d5f754cc6527fcff)


  Commit: f01051dd4edfa27cae33ea46648d9fea8536657b
      https://github.com/llvm/llvm-project/commit/f01051dd4edfa27cae33ea46648d9fea8536657b
  Author: Krzysztof Parzyszek <kparzysz at quicinc.com>
  Date:   2022-02-08 (Tue, 08 Feb 2022)

  Changed paths:
    M clang/lib/Driver/ToolChains/Hexagon.cpp
    M clang/test/Driver/hexagon-hvx.c

  Log Message:
  -----------
  [Hexagon] Alter meaning of versionless -mhvx

The documentation for the official (downstream) Qualcomm Hexagon Clang
states that -mhvx sets the HVX version to be the same as the CPU version.
The current implementation upstream would use the most recent versioned
-mhvx= flag first (if present), then the CPU version. Change the upstream
behavior to match the documented behavior of the downstream compiler.

(cherry picked from commit 2ecda9ec9cc89b87ce2e56452229c9444beabf21)


  Commit: 4f624dd81687dcad957421ca6803e81a2262c4f4
      https://github.com/llvm/llvm-project/commit/4f624dd81687dcad957421ca6803e81a2262c4f4
  Author: Piotr Kubaj <pkubaj at FreeBSD.org>
  Date:   2022-02-08 (Tue, 08 Feb 2022)

  Changed paths:
    M clang/lib/Headers/ppc_wrappers/mm_malloc.h

  Log Message:
  -----------
  [PowerPC] Fix SSE translation on FreeBSD

This patch drops throws specifier in posix_memalign declaration because
that's different between glibc and other libc, and Clang has a hack.

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

(cherry picked from commit f2f4080c10f4319adf75c660425911cd4e0e1843)


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

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/avx512fp16-arith-intrinsics.ll
    M llvm/test/CodeGen/X86/vector-bo-select.ll

  Log Message:
  -----------
  [x86] invert a vector select IR canonicalization with a binop identity constant

This is an intentionally limited/different form of D90113.
That patch bravely tries to generalize folds where we pull
a binop into the arms of a select:
N0 + (Cond ? 0 : FVal) --> Cond ? N0 : (N0 + FVal)
...but it is not universally profitable.

This is the inverse of IR canonicalization as discussed in
D113442.

We know that this transform is not entirely profitable even
within x86, so we only handle x86 vector fadd/fsub as a 1st
step. The intent is to prevent AVX512 regressions as mentioned
in D113442.

The plan is to port this to DAGCombiner (so it will eventually
look more like D90113) and add more types/cases in pieces with
many more tests to verify that we are seeing improvements.

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

(cherry picked from commit 6592bcecd4ffc03f72d23f81bcb8d51f8ebeb07d)


Compare: https://github.com/llvm/llvm-project/compare/0ad6c094176e...a2f583280e48


More information about the All-commits mailing list