Changes

Summary

  1. [RISCV] Don't enable Interleaved Access Vectorization (details)
  2. [dfsan] Replace dfs$ prefix with .dfsan suffix (details)
  3. [Attributor][NFC] AAReachability is currently stateless, don't invalidate it (details)
  4. [Attributor][NFC] Precommit a set of test cases for load simplification (details)
  5. [Attributor][NFC] Add test from PR49606 (details)
  6. [OpenMP][NFC] Expose AAExecutionDomain and rename its getter (details)
  7. [Attributor] Make sure Heap2Stack works properly on a GPU target (details)
  8. [Attributor] Introduce a helper do deal with constant type mismatches (details)
  9. [Attributor] Use a centralized value simplification interface (details)
  10. [Attributor] Allow to skip the initial update for a new AA (details)
  11. [Attributor][FIX] Arguments of unknown functions can be undef (details)
  12. Revert D103717 "[InstrProfiling] Make __profd_ unconditionally private for ELF" (details)
  13. [polly][GPGPU] Fixup related to overloading exponent type in llvm.powi (details)
  14. [InstCombine] Fold (sext bool X) * (sext bool X) to zext (and X, X) (details)
  15. [libc] Add few macro definitions to make it easy to accommodate Windows. (details)
  16. Revert "[InstCombine] Fold (sext bool X) * (sext bool X) to zext (and X, X)" (details)
  17. [Demangle][Rust] Parse dot suffix (details)
Commit c2e97ba85e46b4d99b13d651f58179251fce9007 by luke957
[RISCV] Don't enable Interleaved Access Vectorization

The patch https://reviews.llvm.org/D101469 is intended to enable loop unrolling,
not interleaved access vectorization. The method bool enableInterleavedAccessVectorization()
should not be implemented.
The file was modifiedllvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
Commit c6b5a25eeb336bb1e6abcba8131b946552432ac0 by gbalats
[dfsan] Replace dfs$ prefix with .dfsan suffix

The current naming scheme adds the `dfs$` prefix to all
DFSan-instrumented functions.  This breaks mangling and prevents stack
trace printers and other tools from automatically demangling function
names.

This new naming scheme is mangling-compatible, with the `.dfsan`
suffix being a vendor-specific suffix:
https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-structure

With this fix, demangling utils would work out-of-the-box.

Reviewed By: stephan.yichao.zhao

Differential Revision: https://reviews.llvm.org/D104494
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/origin_store_threshold.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/args-unreachable-bb.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/origin_abilist.ll
The file was modifiedcompiler-rt/test/dfsan/origin_unaligned_memtrans.c
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/origin_store.ll
The file was modifiedcompiler-rt/test/dfsan/origin_stack_trace.c
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/memset.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/custom_fun_callback_attributes.ll
The file was modifiedclang/docs/DataFlowSanitizerDesign.rst
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/debug-nonzero-labels.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/basic.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/load.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/origin_load.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/origin_other_ops.ll
The file was modifiedcompiler-rt/test/dfsan/origin_with_signals.cpp
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/musttailcall.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/origin_select.ll
The file was modifiedllvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/custom_fun_varargs_attributes.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/origin_phi.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/store.ll
The file was modifiedcompiler-rt/test/dfsan/origin_memcpy.c
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/external_mask.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/union.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/origin_call.ll
The file was modifiedcompiler-rt/test/dfsan/pthread.c
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/call.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/origin_mem_intrinsic.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/vector.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/shadow-args-zext.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/unordered_atomic_mem_intrins.ll
The file was modifiedcompiler-rt/test/dfsan/origin_memmove.c
The file was modifiedcompiler-rt/test/dfsan/origin_track_ld.c
The file was modifiedcompiler-rt/test/dfsan/stack_trace.c
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/origin_track_load.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/abilist.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/origin_cached_shadows.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/dont_combine_offset_labels_on_gep.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/prefix-rename.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/select.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/abilist_aggregate.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/atomics.ll
The file was modifiedcompiler-rt/test/dfsan/origin_with_sigactions.c
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/arith.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/array.ll
The file was modifiedllvm/test/Instrumentation/DataFlowSanitizer/struct.ll
Commit 8d7bace3b517e4f1ef43375e65f6c4da115ffef8 by johannes
[Attributor][NFC] AAReachability is currently stateless, don't invalidate it

We invalidated AAReachabilityImpl directly which is not helpful and
confusing as we still used it regardless. We now avoid invalidating it
(not needed anyway) and add checks for the state. This has by itself no
actual effect but prepares for later extensions.
The file was modifiedllvm/include/llvm/Transforms/IPO/Attributor.h
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp
Commit 39e1876b0649b35de2ca3bff1983be82dca0bbcc by johannes
[Attributor][NFC] Precommit a set of test cases for load simplification
The file was addedllvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
Commit ca7563bb02689a7145a7348d8b7a9676189df296 by johannes
[Attributor][NFC] Add test from PR49606

It is not clear to me how we fixed this, I reverted a few candidates but
I couldn't make the test fail. Still worth having it in our regression
suite.
The file was addedllvm/test/Transforms/Attributor/cgscc_bugs.ll
Commit 9a23e673caebdd54d8cc285fcad78f18fa2e919a by johannes
[OpenMP][NFC] Expose AAExecutionDomain and rename its getter

The initial use for AAExecutionDomain was to determine if a single
thread executes a block. While this is sometimes informative most
of the time, and for other reasons, we actually want to know if it
is the "initial thread". Thus, the thread that started execution on
the current device. The deduction needs to be adjusted in a follow
up as the methods we use right not are looking for the OpenMP thread
id which is resets whenever a thread enters a parallel region. What
we basically want is to look for `llvm.nvvm.read.ptx.sreg.ntid.x` and
equivalent functions.
The file was modifiedllvm/include/llvm/Transforms/IPO/Attributor.h
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
Commit 9959eee0015a97f3eb6bdb1b7b1f500190d66f53 by johannes
[Attributor] Make sure Heap2Stack works properly on a GPU target

If the target stack is not accessible between different running
"threads" we have to make sure not to create allocas for mallocs
that might be used by multiple "threads". The "use check" is
sufficient to prevent this but if we apply the "free check" we have
to make sure the pointer is not communicated to others before
the free is reached.

Differential Revision: https://reviews.llvm.org/D98608
The file was modifiedllvm/include/llvm/Transforms/IPO/Attributor.h
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp
The file was modifiedllvm/test/Transforms/Attributor/depgraph.ll
The file was addedllvm/test/Transforms/Attributor/heap_to_stack_gpu.ll
Commit d9194b6efb4d287d2a9f2ad216a6fb5b7b260353 by johannes
[Attributor] Introduce a helper do deal with constant type mismatches

If we simplify values we sometimes end up with type mismatches. If the
value is a constant we can often cast it though to still allow
propagation. The logic is now put into a helper and it replaces some
ad hoc things we did before.

This also introduces the AA namespace for abstract attribute related
functions and types.

Differential Revision: https://reviews.llvm.org/D103856
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp
The file was modifiedllvm/lib/Transforms/IPO/Attributor.cpp
Commit 666dc6f1267dfedcd0502a1f8fbd9aafe463e06a by johannes
[Attributor] Use a centralized value simplification interface

To allow outside AAs that simplify values we need to ensure all value
simplification goes through the Attributor, not AAValueSimplify (or any
of the other AAs we have already like AAPotentialValues). This patch
also introduces an interface for the outside AAs to register
simplification callbacks for an IRPosition. To make this work as
expected we have to pass IRPositions instead of Values in
AAValueSimplify, which makes sense by itself.
The file was modifiedllvm/test/Transforms/Attributor/internalize.ll
The file was modifiedllvm/include/llvm/Transforms/IPO/Attributor.h
The file was modifiedllvm/test/Transforms/Attributor/IPConstantProp/multiple_callbacks.ll
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp
The file was modifiedllvm/lib/Transforms/IPO/Attributor.cpp
The file was modifiedllvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll
The file was modifiedllvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll
Commit 3d6df0108b48358b8cdc6cf3267300c217fe823c by johannes
[Attributor] Allow to skip the initial update for a new AA

Users might want to run initialize for a set of AAs without an
intermediate update step. Running update eagerly is not a requirement
anyway so we make it optional.
The file was modifiedllvm/include/llvm/Transforms/IPO/Attributor.h
Commit 30c9d68ad93af7f420f6d01f91adf12ff36254a0 by johannes
[Attributor][FIX] Arguments of unknown functions can be undef

This should fix PR50683. The wrong assumption was that we
could always know what the callee is when we replace a call site
argument with undef. We wanted to know that to remove the `noundef`
that might be attached to the argument. Since no callee means we
did the propagation on the caller site, there is no need to remove
an attribute. It is only needed if we replace all uses and therefore
pass `undef` instead of the value that was passed in otherwise.
The file was modifiedllvm/test/Transforms/Attributor/value-simplify.ll
The file was modifiedllvm/lib/Transforms/IPO/Attributor.cpp
Commit 5798be84580be233e4cf34c08ceec8f79e80502e by i
Revert D103717 "[InstrProfiling] Make __profd_ unconditionally private for ELF"

This reverts commit 76d0747e0807307780ba84cbd7e5c80b20c26bd7.

If a group has `__llvm_prf_vals` due to static value profiler counters
(`NS!=0`), we cannot make `__llvm_prf_data` private, because a prevailing text
section may reference `__llvm_prf_data` and will cause a `relocation refers to a
discarded section` linker error.

Note: while a `__profc_` group is non-prevailing, it may be referenced by a
prevailing text section due to inlining.

```
group section [   66] `.group' [__profc__ZN5clang20EmitClangDeclContextERN4llvm12RecordKeeperERNS0_11raw_ostreamE] contains 4 sections:
   [Index]    Name
   [   67]   __llvm_prf_cnts
   [   68]   __llvm_prf_vals
   [   69]   __llvm_prf_data
   [   70]   .rela__llvm_prf_data
```
The file was modifiedllvm/test/Transforms/PGOProfile/indirect_call_profile.ll
The file was modifiedllvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
Commit 6aac2773d80b42bcf9da2414bbd410aa9f10095e by bjorn.a.pettersson
[polly][GPGPU] Fixup related to overloading exponent type in llvm.powi

Commit 4c7f820b2b206bb changed the llvm.powi intrinsic to support
different 'int' sizes for the exponent. That happened to break
the IntrinsicToLibdeviceFunc mapping in PPCGCodeGeneration, which
obviously should have been updated as part of commit 4c7f820b2b
(https://reviews.llvm.org/D99439).

The shortcoming was found by buildbots that use
   -DPOLLY_ENABLE_GPGPU_CODEGEN=ON

This patch should fixup the problem.
The file was modifiedpolly/test/GPGPU/libdevice-functions-copied-into-kernel.ll
The file was modifiedpolly/lib/CodeGen/PPCGCodeGeneration.cpp
Commit 31053338c97b36ffb582f9c04a74cec69cce3e70 by vdsered
[InstCombine] Fold (sext bool X) * (sext bool X) to zext (and X, X)

InstCombine didn't perform (sext bool X) * (sext bool X) --> zext (and X, X) which can result in just (zext X). The patch adds regression tests to check this transformation and adds a check for equality of mul's operands for that case.

Differential Revision: https://reviews.llvm.org/D104193
The file was modifiedllvm/test/Transforms/InstCombine/mul.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
Commit 37afd67c38cf85f1308505892e7999457d8769cd by sivachandra
[libc] Add few macro definitions to make it easy to accommodate Windows.

The new macro definitions have been used to add Windows specific
specializations.
The file was modifiedlibc/utils/FPUtil/NormalFloat.h
The file was modifiedlibc/utils/FPUtil/Sqrt.h
The file was modifiedlibc/utils/FPUtil/SqrtLongDoubleX86.h
The file was modifiedlibc/utils/FPUtil/ManipulationFunctions.h
The file was addedlibc/utils/FPUtil/PlatformDefs.h
The file was modifiedlibc/utils/FPUtil/FPBits.h
Commit 6de741de08a11048027cb4d4e4d5d4bd067319fa by vdsered
Revert "[InstCombine] Fold (sext bool X) * (sext bool X) to zext (and X, X)"

This reverts commit 31053338c97b36ffb582f9c04a74cec69cce3e70.
The file was modifiedllvm/test/Transforms/InstCombine/mul.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
Commit 2a5bb9c877f23224ee6b789054b4edfa17b4fd30 by tomasz.miasko
[Demangle][Rust] Parse dot suffix

Allow mangled names to include an arbitrary dot suffix, akin to vendor
specific suffix in Itanium mangling.

Primary motivation is a support for symbols renamed during ThinLTO
import / promotion (ThinLTO is the default configuration for optimized
builds in rustc).

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D104358
The file was modifiedllvm/lib/Demangle/RustDemangle.cpp
The file was modifiedllvm/test/Demangle/rust.test