Changes

Summary

  1. [ObjC][ARC] Use the addresses of the ARC runtime functions instead of (details)
  2. [ObjC][ARC] Use the addresses of the ARC runtime functions instead of (details)
  3. [libc++][NFC] Rename _EnableIf to __enable_if_t for consistency (details)
  4. [ConstantHoisting] Support opaque pointers (details)
  5. Move delinearization logic out of SCEV [NFC] (details)
  6. [libc++] Revert OpenBSD-related changes to the documentation (details)
  7. [MemorySSA] Support invariant.group metadata (details)
  8. [AIX] Check for typedef properly when getting preferred type align (details)
  9. [SROA] Support opaque pointers (details)
  10. [Polly] Compile fix after Delinearization move. (details)
  11. [Canonicalize] Don't call isBeforeInBlock in OperationFolder::tryToFold. (details)
  12. [LAA] Remove unused OrigPtr from replaceSymbolicStrideSCEV (NFC). (details)
  13. [lldb] Make sure there's a value for the key before dereferencing. (details)
  14. [openmp] Re-enable test from D109057, now with windows path aware regex (details)
  15. Log to the right stream in DwarfTransformer::handleDie(). (details)
  16. [runtimes] Set more paths when building runtimes standalone (details)
  17. [runtimes] Allow overriding where CMake installs RUNTIME type libraries (DLLs) (details)
  18. [Delinerization] Require by offset to be zero. (details)
  19. [openmp] 41c73671d0, this time with staged patch applied (details)
  20. [NFC] Add extra test for D106331 (details)
  21. [RISCV] Disable use of i128 shift libcalls on RV32. (details)
  22. Port the cost model printer to New PM (details)
  23. [AArch64] Rewrite floatdp_1source.ll test. NFC (details)
  24. [CodeExtractor] Creating exit stubs based off original order branch instructions. (details)
  25. [SCEV] Simplify findExistingSCEVInCache interface [NFC] (details)
Commit 59cc39ae141f92c01836064cd033c537f16dec5e by Akira
[ObjC][ARC] Use the addresses of the ARC runtime functions instead of
integer 0/1 for the operand of bundle "clang.arc.attachedcall"

This should make it easier to understand what the IR is doing and also
simplify some of the passes as they no longer have to translate the
integer values to the runtime functions.

Differential Revision: https://reviews.llvm.org/D102996
The file was modifiedclang/test/CodeGenObjCXX/arc-rv-attr.mm
The file was modifiedclang/lib/CodeGen/CGObjC.cpp
The file was modifiedclang/test/CodeGenObjC/arc-rv-attr.m
Commit dea6f71af0fdd7c54cacd43f5fb15e293924fa20 by Akira
[ObjC][ARC] Use the addresses of the ARC runtime functions instead of
integer 0/1 for the operand of bundle "clang.arc.attachedcall"

https://reviews.llvm.org/D102996 changes the operand of bundle
"clang.arc.attachedcall". This patch makes changes to llvm that are
needed to handle the new IR.

This should make it easier to understand what the IR is doing and also
simplify some of the passes as they no longer have to translate the
integer values to the runtime functions.

Differential Revision: https://reviews.llvm.org/D103000
The file was modifiedllvm/test/CodeGen/AArch64/call-rv-marker.ll
The file was modifiedllvm/test/CodeGen/X86/expand-call-rvmarker.mir
The file was modifiedllvm/test/Transforms/ObjCARC/rv.ll
The file was modifiedllvm/test/CodeGen/X86/call-rv-marker.ll
The file was modifiedllvm/test/Transforms/ObjCARC/contract-marker-funclet.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/include/llvm/IR/InstrTypes.h
The file was modifiedllvm/lib/IR/Verifier.cpp
The file was modifiedllvm/lib/Transforms/ObjCARC/ObjCARC.h
The file was modifiedllvm/test/Verifier/invoke.ll
The file was modifiedllvm/include/llvm/IR/Function.h
The file was modifiedllvm/lib/IR/Function.cpp
The file was modifiedllvm/lib/Target/X86/X86InstrCompiler.td
The file was modifiedllvm/test/Transforms/ObjCARC/contract-rv-attr.ll
The file was modifiedllvm/lib/Target/X86/X86InstrControl.td
The file was modifiedllvm/test/Transforms/SCCP/clang-arc-rv.ll
The file was modifiedllvm/lib/Transforms/Utils/InlineFunction.cpp
The file was modifiedllvm/test/Verifier/operand-bundles.ll
The file was modifiedllvm/test/Transforms/TailCallElim/deopt-bundle.ll
The file was modifiedllvm/include/llvm/Analysis/ObjCARCUtil.h
The file was modifiedllvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
The file was modifiedllvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp
The file was modifiedllvm/lib/Target/X86/X86ExpandPseudo.cpp
The file was modifiedllvm/lib/Transforms/ObjCARC/ObjCARC.cpp
The file was modifiedllvm/docs/LangRef.rst
The file was modifiedllvm/test/Transforms/DeadArgElim/deadretval.ll
The file was modifiedllvm/test/Transforms/Inline/inline-retainRV-call.ll
Commit b4e88d4db12e9460e581de453c8603eb280f145b by Louis Dionne
[libc++][NFC] Rename _EnableIf to __enable_if_t for consistency

In other places in the code, we use lowercase spelling for things that
are not available in prior standards.

Differential Revision: https://reviews.llvm.org/D109435
The file was modifiedlibcxx/include/__functional/bind.h
The file was modifiedlibcxx/include/__iterator/reverse_iterator.h
The file was modifiedlibcxx/include/math.h
The file was modifiedlibcxx/include/tuple
The file was modifiedlibcxx/include/__memory/allocator_traits.h
The file was modifiedlibcxx/include/__memory/shared_ptr.h
The file was modifiedlibcxx/include/__iterator/advance.h
The file was modifiedlibcxx/include/__iterator/move_iterator.h
The file was modifiedlibcxx/include/queue
The file was modifiedlibcxx/include/bitset
The file was modifiedlibcxx/include/__functional/reference_wrapper.h
The file was modifiedlibcxx/include/type_traits
The file was modifiedlibcxx/include/__memory/pointer_traits.h
The file was modifiedlibcxx/include/__iterator/iterator_traits.h
The file was modifiedlibcxx/include/stack
The file was modifiedlibcxx/include/string
Commit 3e54de4df232f1cfc9570ea7958abee8d04f7b0b by nikita.ppv
[ConstantHoisting] Support opaque pointers

Directly use i8 for GEP, rather than fetching element type of i8*.
The file was modifiedllvm/test/CodeGen/AArch64/consthoist-gep.ll
The file was modifiedllvm/lib/Transforms/Scalar/ConstantHoisting.cpp
Commit 585c594d749a2a88150b63804587af85abdabeaa by listmail
Move delinearization logic out of SCEV [NFC]

None of this logic has anything to do with SCEV's internals, it just uses the existing public APIs.  As a result, we can move the code from ScalarEvolution.cpp/hpp to Delinearization.cpp/hpp with only minor changes.

This was discussed in advance on today's loop opt call.  It turned out to be easy as hoped.
The file was modifiedllvm/lib/Analysis/Delinearization.cpp
The file was modifiedllvm/lib/Analysis/DependenceAnalysis.cpp
The file was modifiedllvm/lib/Analysis/LoopCacheAnalysis.cpp
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
The file was modifiedllvm/include/llvm/Analysis/Delinearization.h
The file was modifiedllvm/include/llvm/Analysis/ScalarEvolution.h
Commit ff7a332e6f5d4b09b4e437cc2c014367724b3eee by Louis Dionne
[libc++] Revert OpenBSD-related changes to the documentation

This commit partially reverts 0954e2b2d038 and 3fa4cff97480, which
make changes to the libc++ documentation implifying that OpenBSD is
supported. Neither of these changes have been reviewed AFAICT, so
I'm reverting as a matter of enforcing:

1. That changes get reviewed before being committed
2. That we have a discussion and a support plan for supporting
   OpenBSD officially in libc++

Please note that I would be thrilled to support OpenBSD officially in
libc++, however doing so requires more than adding a note in the docs.
In particular, please make sure you read the note in [1] about setting
up CI testing for OpenBSD.

[1]: https://libcxx.llvm.org/#platform-and-compiler-support

Differential Revision: https://reviews.llvm.org/D109373
The file was modifiedlibcxx/docs/UsingLibcxx.rst
The file was modifiedlibcxx/docs/index.rst
Commit b493124ae2de5074acc8207155274f84732cd06b by aeubanks
[MemorySSA] Support invariant.group metadata

The implementation is mostly copied from MemDepAnalysis. We want to look
at all loads and stores to the same pointer operand. Bitcasts and zero
GEPs of a pointer are considered the same pointer value. We choose the
most dominating instruction.

Since updating MemorySSA with invariant.group is non-trivial, for now
handling of invariant.group is not cached in any way, so it's part of
the walker. The number of loads/stores with invariant.group is small for
now anyway. We can revisit if this actually noticeably affects compile
times.

To avoid invariant.group affecting optimized uses, we need to have
optimizeUsesInBlock() not use invariant.group in any way.

Co-authored-by: Piotr Padlewski <prazek@google.com>

Reviewed By: asbirlea, nikic, Prazek

Differential Revision: https://reviews.llvm.org/D109134
The file was removedllvm/test/Transforms/NewGVN/invariant.group-xfail.ll
The file was modifiedllvm/test/Analysis/MemorySSA/invariant-groups.ll
The file was modifiedllvm/unittests/Analysis/MemorySSATest.cpp
The file was addedllvm/test/Transforms/NewGVN/invariant.group.ll
The file was modifiedllvm/lib/Analysis/MemorySSA.cpp
Commit 806ff3c4a42c7393a0bbeab3dd1c0295f61ad457 by wanyu9511
[AIX] Check for typedef properly when getting preferred type align

The current check for typedef is naive and doesn't deal with any convoluted cases. This patch makes use of the new 'AlignRequirement' enum field from 'TypeInfo' to determine whether or not this is an 'aligned' attribute on a typedef.

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D109387
The file was modifiedclang/test/Layout/aix-power-alignment-typedef-2.cpp
The file was modifiedclang/lib/AST/ASTContext.cpp
Commit 6dfdc6bfd22a92e06a027527f4eb794009811175 by nikita.ppv
[SROA] Support opaque pointers

Make the following changes in order to support opaque pointers in SROA:

* Generate i8 GEPs for opaque pointers.
* Explicitly enforce that promotable allocas only have stores of
   the alloca type -- previously this was implicitly enforced.
* Replace a check for pointer element type with load/store type.

Differential Revision: https://reviews.llvm.org/D109259
The file was modifiedllvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
The file was addedllvm/test/Transforms/SROA/basictest-opaque-ptrs.ll
The file was modifiedllvm/lib/Transforms/Scalar/SROA.cpp
Commit 8ae69338819d18d7a3669d8b51591bf742c61946 by llvm-project
[Polly] Compile fix after Delinearization move.

by commit 585c594d749a2a88150b63804587af85abdabeaa
The file was modifiedpolly/lib/Analysis/ScopDetection.cpp
Commit 40a89da65ce85163123cdfec66afdcf2fa3687ce by clattner
[Canonicalize] Don't call isBeforeInBlock in OperationFolder::tryToFold.

This patch (e4635e6328c8) fixed a bug where a newly generated/reused
constant wouldn't dominate a folded operation.  It did so by calling
isBeforeInBlock to move the constant around on demand.  This introduced
a significant compile time regression, because "isBeforeInBlock" is
O(n) in the size of a block the first time it is called, and the cache
is invalidated any time canonicalize changes something big in the block.

This fixes LLVM PR51738 and this CIRCT issue:
https://github.com/llvm/circt/issues/1700

This does affect the order of constants left in the top of a block,
I staged in the testsuite changes in rG42431b8207a5.

Differential Revision: https://reviews.llvm.org/D109454
The file was modifiedmlir/lib/Transforms/Utils/FoldUtils.cpp
Commit f4726e72386d4107f427f3b4825bdfb92d0d1a1e by flo
[LAA] Remove unused OrigPtr from replaceSymbolicStrideSCEV (NFC).

The OrigPtr argument is not used in tree.
The file was modifiedllvm/lib/Analysis/LoopAccessAnalysis.cpp
The file was modifiedllvm/include/llvm/Analysis/LoopAccessAnalysis.h
Commit d1d4f365566ce9aae40d1f46cae517e4fe8fe6ee by Jonas Devlieghere
[lldb] Make sure there's a value for the key before dereferencing.

Make sure there's a value for the shared_cache_base_address key exists
in the dictionary before trying to dereference the value.

rdar://76894476
The file was modifiedlldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
Commit 41c73671d0b851c601ceb85c7e38afa21819bde7 by jonathanchesterfield
[openmp] Re-enable test from D109057, now with windows path aware regex
The file was modifiedclang/test/Driver/openmp-offload-gpu.c
Commit 14850a062845bef842ee54417b8a0771dbc732a4 by gclayton
Log to the right stream in DwarfTransformer::handleDie().

Since we might end up using multiple threads when logging information in the DWARFTransformer, the handleDie() method must use the supplied stream named "OS" when logging warnings and errors. When we use multiple threads, we log to a thread specific stream buffer and then use a mutex to ensure our output doesn't overlap when we emit warnings and errors after a thread is done.

Differential Revision: https://reviews.llvm.org/D109401
The file was modifiedllvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
Commit 407e07aa67ab56c92cdec1fdbf6b121afbceddaf by martin
[runtimes] Set more paths when building runtimes standalone

These paths are needed when building with per-target runtime directories.

(It's possible to fix this by manually setting these when invoking
cmake, but one isn't supposed to need to do that.)

Also set LLVM_TOOLS_BINARY_DIR while touching this area (as it's
also unset in this case) even if it isn't specifically needed by the
per-target runtime configuration.

Differential Revision: https://reviews.llvm.org/D107895
The file was modifiedlibcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
The file was modifiedruntimes/CMakeLists.txt
Commit c4e8a2136c00473f42e54a05bd2634ffc08388ca by martin
[runtimes] Allow overriding where CMake installs RUNTIME type libraries (DLLs)

Differential Revision: https://reviews.llvm.org/D107892
The file was modifiedlibcxx/src/CMakeLists.txt
The file was modifiedlibcxx/CMakeLists.txt
The file was modifiedlibunwind/CMakeLists.txt
The file was modifiedlibunwind/src/CMakeLists.txt
The file was modifiedlibcxxabi/src/CMakeLists.txt
The file was modifiedlibcxxabi/CMakeLists.txt
Commit 088577a38e603d3537816de1f2a249d598de8dd9 by llvm-project
[Delinerization] Require by offset to be zero.

Users of delinearization assume that the the offset into the array element is zero. In most cases it will indeed be zero, but if it is not, the delinearization has to fail since it violates that assumption without the API even allowing to signal to the caller that the by offset is non-zero.

This bug caused Polly to miscompile blender (526.blender_r from SPEC CPU 2017) in -polly-process-unprofitable mode. The SCEV expression incorrectly delinearized has been reduced in the test case byte_offset.ll. The dropped offset into the array element of size 4 (a float) is ((sext i32 %mul7.i4534 to i64) + {(sext i32 %i1 to i64),+,((sext i32 (1 + ((1 + %shl.i.i) * (1 + %shl.i.i)) + %shl.i.i) to i64) * (sext i32 %i1 to i64))}<%for.body703>). This significant component was just dropped, and the wrong pointer was computed when regenerating code from the remaining delinearized subscripts. This occurred during blender's subsurface scattering implementation. As a result, blender's rendering diverged from the reference image.

Patch D108885 would also fix the API.

Reviewed By: bmahjour

Differential Revision: https://reviews.llvm.org/D109133
The file was addedllvm/test/Analysis/Delinearization/byte_offset.ll
The file was modifiedllvm/lib/Analysis/Delinearization.cpp
Commit e62f4f172e34b9283ce04c871512165c78ef5f39 by jonathanchesterfield
[openmp] 41c73671d0, this time with staged patch applied
The file was modifiedclang/test/Driver/openmp-offload-gpu.c
Commit 0375734439a0eaeab76a48eff6ef974017bbf4fe by efriedma
[NFC] Add extra test for D106331
The file was modifiedllvm/test/Analysis/ScalarEvolution/no-wrap-symbolic-becount.ll
Commit a574f0e0c347cd8bee97e6770022aeb537542b22 by craig.topper
[RISCV] Disable use of i128 shift libcalls on RV32.

Since i128 isn't a legal C type on RV32, I don't believe
libgcc implements these functions for RV32. compiler-rt
does implement them because i128 support is enabled
in order to handle long double.

This is consistent with 32-bit X86 and ARM.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D109383
The file was modifiedllvm/test/CodeGen/RISCV/shifts.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
Commit fe15347a1e03588376073f38b625acacb93122f4 by aeubanks
Port the cost model printer to New PM

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D109284
The file was modifiedllvm/lib/Passes/PassBuilder.cpp
The file was modifiedllvm/lib/Passes/PassRegistry.def
The file was modifiedllvm/test/CodeGen/ARM/vselect_imax.ll
The file was modifiedllvm/lib/Analysis/CostModel.cpp
The file was modifiedllvm/test/CodeGen/ARM/vcvt-cost.ll
The file was addedllvm/include/llvm/Analysis/CostModel.h
Commit 7ff67d5bf8d049b368625b6fe06c50aedc222939 by david.green
[AArch64] Rewrite floatdp_1source.ll test. NFC

Rewrite this test to not rely on volatile stores in a large function,
just use separate functions like any other test would.
The file was modifiedllvm/test/CodeGen/AArch64/floatdp_1source.ll
Commit 144cd22baef2d068f077e514de1b4f0d8b0973cf by andrew.litteken
[CodeExtractor] Creating exit stubs based off original order branch instructions.

Previously the CodeExtractor created exit stubs, and the subsequent return value of the outlined function based on the order of out-of-region blocks after splitting any phi nodes, and collecting the blocks to be outlined. This could cause differences in order if there was a difference of exit block phi nodes between the two regions. This patch moves the collection of the output target blocks to be before this occurs, so that the assignment of target block to output value will be the same, regardless of the contents of the output block.

Reviewers: paquette, roelofs

Differential Revision: https://reviews.llvm.org/D108657
The file was modifiedllvm/lib/Transforms/Utils/CodeExtractor.cpp
The file was modifiedllvm/include/llvm/Transforms/Utils/CodeExtractor.h
The file was modifiedllvm/unittests/Transforms/Utils/CodeExtractorTest.cpp
Commit 4b5e260b1d5b463a3488372bd7df183ae60ef883 by listmail
[SCEV] Simplify findExistingSCEVInCache interface [NFC]

We were returning a tuple when all but one caller only cared about one piece of the return value.  That one caller can inline the complexity, and we can simplify all other uses.
The file was modifiedllvm/include/llvm/Analysis/ScalarEvolution.h
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp