SuccessChanges

Summary

  1. BasicAAResult::constantOffsetHeuristic - pass APInt arg as const reference. NFCI. (details)
  2. [X86][AVX] Attempt to fold extract_subvector(shuffle(X)) -> extract_subvector(X) (details)
  3. make -fmodules-codegen and -fmodules-debuginfo work also with PCHs (details)
  4. [analyzer] Add CTUImportCppThreshold for C++ files (details)
  5. OpaquePtr: Don't check pointee type for byval/preallocated (details)
  6. [BasicAA] Enable -basic-aa-recphi by default (details)
  7. Fix MSVC "not all control paths return a value" warning. NFC. (details)
  8. AMDGPU/GlobalISel: Work around verifier error in test (details)
  9. [NFC] Add SExt multiuses test (details)
  10. [flang] partially revert upstreamed code to support complex values in runtime support to avoid warnings. (details)
  11. [MLIR][SPIRVToLLVM] SPIR-V types size in bytes function (details)
  12. [PowerPC] Support PCRelative Callees for R_PPC64_REL24 Relocation (details)
Commit 4597bfddf11b7d9dcf373525d0bc889bcc212b13 by llvm-dev
BasicAAResult::constantOffsetHeuristic - pass APInt arg as const reference. NFCI.

Avoids unnecessary APInt copies and silences clang tidy warning.
The file was modifiedllvm/lib/Analysis/BasicAliasAnalysis.cpp
The file was modifiedllvm/include/llvm/Analysis/BasicAliasAnalysis.h
Commit f54402b63a4f5b0b4b15e0f82ce8ff8501b206e6 by llvm-dev
[X86][AVX] Attempt to fold extract_subvector(shuffle(X)) -> extract_subvector(X)

If we're extracting a subvector from a shuffle that is shuffling entire subvectors we can peek through and extract the subvector from the shuffle source instead.

This helps remove some cases where concat_vectors(extract_subvector(),extract_subvector()) legalizations has resulted in BLEND/VPERM2F128 shuffles of the subvectors.
The file was modifiedllvm/test/CodeGen/X86/known-signbits-vector.ll
The file was modifiedllvm/test/CodeGen/X86/packss.ll
The file was modifiedllvm/test/CodeGen/X86/var-permute-256.ll
The file was modifiedllvm/test/CodeGen/X86/vector-pack-256.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/avx512-intrinsics-fast-isel.ll
The file was modifiedllvm/test/CodeGen/X86/x86-interleaved-access.ll
The file was modifiedllvm/test/CodeGen/X86/avx-vperm2x128.ll
Commit 31b05692cd33b6dcc39402169b36d895e1aa87f4 by l.lunak
make -fmodules-codegen and -fmodules-debuginfo work also with PCHs

Allow to build PCH's (with -building-pch-with-obj and the extra .o file)
with -fmodules-codegen -fmodules-debuginfo to allow emitting shared code
into the extra .o file, similarly to how it works with modules. A bit of
a misnomer, but the underlying functionality is the same. This saves up
to 20% of build time here. The patch is fairly simple, it basically just
duplicates -fmodules checks to also alternatively check
-building-pch-with-obj.

This already got committed as cbc9d22e49b434b6ceb2eb94b67079d02e0a7b74,
but then got reverted in 7ea9a6e0220da36ff2fd1fbc29c2755be23e5166
because of PR44953, as discussed in D74846. This is a corrected version
which does not include two places for the PCH case that aren't included
in the modules -fmodules-codegen path either.

Differential Revision: https://reviews.llvm.org/D69778
The file was modifiedclang/lib/Serialization/ASTReaderDecl.cpp
The file was modifiedclang/lib/Serialization/ASTWriterDecl.cpp
The file was modifiedclang/lib/Serialization/ASTWriter.cpp
The file was modifiedclang/test/Modules/Inputs/codegen-flags/foo.h
The file was addedclang/test/PCH/codegen.cpp
The file was modifiedclang/lib/Serialization/ASTReader.cpp
Commit d12d0b73f1c9c3a711c5cc15266a2b493cd712e9 by gabor.marton
[analyzer] Add CTUImportCppThreshold for C++ files

Summary:
The default CTUImportThreshold (8) seems to be too conservative with C projects.
We increase this value to 24 and we introduce another threshold for C++ source
files (defaulted to 8) because their AST is way more compilcated than C source
files.

Differential Revision: https://reviews.llvm.org/D83475
The file was modifiedclang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def
The file was modifiedclang/lib/CrossTU/CrossTranslationUnit.cpp
The file was modifiedclang/unittests/CrossTU/CrossTranslationUnitTest.cpp
The file was modifiedclang/test/Analysis/analyzer-config.c
The file was modifiedclang/test/Analysis/ctu-import-threshold.c
Commit 6f5d9136b27eefc981333d8c23ea9c0a38033d7b by Matthew.Arsenault
OpaquePtr: Don't check pointee type for byval/preallocated

Since none of these users really care about the actual type, hide the
type under a new size-getting attribute to go along with
hasPassPointeeByValueAttr. This will work better for the future byref
attribute, which may end up only tracking the byte size and not the IR
type.

We currently have 3 parameter attributes that should carry the type
(technically inalloca does not yet). The APIs are somewhat awkward
since preallocated/inalloca piggyback on byval in some places, but in
others are treated as distinct attributes. Since these are all
mutually exclusive, we should probably just merge all the attribute
infrastructure treating these as totally distinct attributes.
The file was modifiedllvm/lib/IR/Function.cpp
The file was modifiedllvm/lib/IR/Mangler.cpp
The file was modifiedllvm/include/llvm/IR/Argument.h
Commit af839a96187e3538d63ad57571e4bdf01e2b15c5 by david.green
[BasicAA] Enable -basic-aa-recphi by default

This option was added a while back, to help improve AA around pointer
phi loops. It looks for phi(gep(phi, const), x) loops, checking if x can
then prove more precise aliasing info.

Differential Revision: https://reviews.llvm.org/D82998
The file was modifiedllvm/test/Analysis/BasicAA/phi-loop.ll
The file was modifiedllvm/test/Analysis/BasicAA/recphi.ll
The file was modifiedllvm/lib/Analysis/BasicAliasAnalysis.cpp
Commit 3514f58fbea5967a967468633c901e9b2f241594 by llvm-dev
Fix MSVC "not all control paths return a value" warning. NFC.
The file was modifiedllvm/tools/llvm-objdump/llvm-objdump.cpp
Commit fdde69aac9b99a5cda49c5b738dc8dc67ea4cbbd by Matthew.Arsenault
AMDGPU/GlobalISel: Work around verifier error in test

The unfortunate split between finalizeLowering and the selector pass
means there's a point where the verifier fails. The DAG selector pass
skips the verifier, but this seems to not work when using the
GlobalISel fallback.
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/dynamic-alloca-divergent.ll
Commit a0e981c190ffa0ad6b521222bc2fba504c9750ec by diogo.sampaio
[NFC] Add SExt multiuses test
The file was addedllvm/test/Transforms/BDCE/sext_multi_uses.ll
Commit 7cd1b0ff347d7aa4864624501efbe2ac609e67d7 by eschweitz
[flang] partially revert upstreamed code to support complex values in runtime support to avoid warnings.
The file was modifiedflang/runtime/pgmath.h.inc
The file was modifiedflang/lib/Evaluate/intrinsics-library.cpp
Commit 5d075beae73f3d9570230c0780e74dc32dda39a9 by georgemitenk0v
[MLIR][SPIRVToLLVM] SPIR-V types size in bytes function

Added `getSizeInBytes()` function as a class member to several SPIR-V types:
`ScalarType`, `ArrayType` and `VectorType`. This function aims at exposing
the functionality of `getTypeNumBytes()` from `SPIRVLowering.cpp`. Support
of more types will be added on demand.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D83285
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVTypes.cpp
Commit beb52b12cb175d0df9bf168837d153f857f69eda by kamau.bridgeman
[PowerPC] Support PCRelative Callees for R_PPC64_REL24 Relocation

The R_PPC64_REL24 is used in function calls when the caller requires a
valid TOC pointer. If the callee shares the same TOC or does not clobber
the TOC pointer then a direct call can be made. If the callee does not
share the TOC a thunk must be added to save the TOC pointer for the caller.

Up until PC Relative was introduced all local calls on medium and large code
models were assumed to share a TOC. This is no longer the case because
if the caller requires a TOC and the callee is PC Relative then the callee
can clobber the TOC even if it is in the same DSO.

This patch is to add support for a TOC caller calling a PC Relative callee that
clobbers the TOC.

Reviewed By: sfertile, MaskRay

Differential Revision: https://reviews.llvm.org/D82950
The file was addedlld/test/ELF/ppc64-toc-call-to-pcrel-long-jump.s
The file was modifiedlld/ELF/Arch/PPC64.cpp
The file was addedlld/test/ELF/ppc64-error-toc-local-call.s
The file was addedlld/test/ELF/ppc64-toc-call-to-pcrel.s
The file was modifiedlld/ELF/Thunks.cpp