SuccessChanges

Summary

  1. [NewPM][CodeGen] Introduce CodeGenPassBuilder to help build codegen pipeline (details)
  2. [ConstantFold] Fold binary arithmetic on scalable vector splats. (details)
  3. [NFC] Remove unused static function (details)
  4. Fix a typo in 31ecf8d29d81d196374a562c6d2bd2c25a62861e (details)
  5. [gn build] Port 31ecf8d29d8 (details)
  6. [ConstantFold] Make areGlobalsPotentiallyEqual less aggressive. (details)
  7. [lldb] Use GetNonKVOClassDescriptor to get the NSDictionary class descriptor (details)
  8. Fix a couple of tests that relied on the clang binary having 'clang' somewhere in the name (details)
  9. [gn] Remove unneeded MC dep from llvm-tblgen (details)
  10. Revert "[NewPM][CodeGen] Introduce CodeGenPassBuilder to help build codegen pipeline" (details)
  11. [gn build] Port ad99e34c59b (details)
Commit 31ecf8d29d81d196374a562c6d2bd2c25a62861e by Yuanfang Chen
[NewPM][CodeGen] Introduce CodeGenPassBuilder to help build codegen pipeline

Following up on D67687.
Please refer to the RFC here http://lists.llvm.org/pipermail/llvm-dev/2020-July/143309.html

`CodeGenPassBuilder` is the NPM counterpart of `TargetPassConfig` with below differences.
- Debugging features (MIR print/verify, disable pass, start/stop-before/after, etc.) living in `TargetPassConfig` are moved to use PassInstrument as much as possible. (Implementation also lives in `TargetPassConfig.cpp`)
- `TargetPassConfig` is a polymorphic base (virtual inheritance) to build the target-dependent pipeline whereas `CodeGenPassBuilder` is the CRTP base/helper to implement the target-dependent pipeline. The motivation is flexibility for targets to customize the pipeline, inlining opportunity, and fits the overall NPM value semantics design.
- `TargetPassConfig` is a legacy immutable pass to declare hooks for targets to customize some target-independent codegen layer behavior. This is partially ported to TargetMachine::options. The rest, such as `createMachineScheduler/createPostMachineScheduler`, are left out for now. They should be implemented in LLVMTargetMachine in the future.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D83608
The file was modifiedllvm/lib/CodeGen/TargetPassConfig.cpp
The file was addedllvm/lib/CodeGen/CodeGenPassBuilder.cpp
The file was addedllvm/include/llvm/CodeGen/CGPassBuilderOption.h
The file was modifiedllvm/include/llvm/Passes/StandardInstrumentations.h
The file was modifiedllvm/lib/CodeGen/LLVMTargetMachine.cpp
The file was modifiedllvm/include/llvm/Target/TargetMachine.h
The file was modifiedllvm/lib/CodeGen/CMakeLists.txt
The file was addedllvm/include/llvm/CodeGen/MachinePassRegistry.def
The file was addedllvm/include/llvm/CodeGen/CodeGenPassBuilder.h
Commit 37f2776d1af27a38ba4fabf3b356d71590f70d90 by efriedma
[ConstantFold] Fold binary arithmetic on scalable vector splats.

It's a nice simplification, and it confuses instcombine if we don't do
it.

Differential Revision: https://reviews.llvm.org/D87422
The file was modifiedllvm/lib/IR/ConstantFold.cpp
The file was modifiedllvm/test/Transforms/InstSimplify/ConstProp/vscale.ll
Commit a8503b87f739776cc9d5738f69aa0990db952340 by Vitaly Buka
[NFC] Remove unused static function
The file was modifiedclang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
Commit 3fdaa8602a086a3fca5f0fc8527536ac659079d0 by Yuanfang Chen
Fix a typo in 31ecf8d29d81d196374a562c6d2bd2c25a62861e
The file was modifiedllvm/include/llvm/CodeGen/CodeGenPassBuilder.h
Commit c931dc0bf596ed0a6c4531b0e1f05bd8bda566a6 by llvmgnsyncbot
[gn build] Port 31ecf8d29d8
The file was modifiedllvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn
Commit d751f86189a7f7ef2a6fe06974a5da3349b02f20 by efriedma
[ConstantFold] Make areGlobalsPotentiallyEqual less aggressive.

In particular, we shouldn't make assumptions about globals which are
unnamed_addr: we can fold them together with other globals.

Also while I'm here, use isInterposable() instead of trying to
explicitly name all the different kinds of weak linkage.

Fixes https://bugs.llvm.org/show_bug.cgi?id=47090

Differential Revision: https://reviews.llvm.org/D87123
The file was modifiedllvm/lib/IR/ConstantFold.cpp
The file was modifiedllvm/test/Transforms/InstCombine/2010-03-03-ExtElim.ll
The file was modifiedllvm/test/Assembler/ConstantExprNoFold.ll
Commit 33eb64704292dc2fc8585b8aa7459f96482c6cf9 by Jonas Devlieghere
[lldb] Use GetNonKVOClassDescriptor to get the NSDictionary class descriptor

On macOS Big Sur the class descriptor contains the NSKVONotifying_
prefix. This is covered by TestDataFormatterObjCKVO.

Differential revision: https://reviews.llvm.org/D87545
The file was modifiedlldb/source/Plugins/Language/ObjC/NSDictionary.cpp
Commit 928d419797ea173090e26f624f08801c7d6661e3 by dblaikie
Fix a couple of tests that relied on the clang binary having 'clang' somewhere in the name

Because why would that be necessary? (I joke - I hadn't actually
expected this to be an issue but a content-hash-named filesystem means
the clang binary's just a bunch of numbers, and doesn't have 'clang'
anywhere in the name)
The file was modifiedclang/test/Driver/compress.c
The file was modifiedclang/test/Driver/amdgcn-gz-options.cl
Commit 12a281d368e3ae115b2340c45f93b62e20759811 by rnk
[gn] Remove unneeded MC dep from llvm-tblgen

Tablegen does not have link time dependencies on MC. Having llvm-tblgen
depend on it causes it to be rebuilt in the gn build every time somebody
touches any cpp file in llvm/lib/MC* or llvm/lib/DebugInfo/Codeview*.
Touching tablegen invalidates most of the rest of the build, and
re-running it takes a while. This is is annoying for me when swapping
between branches that touch CodeView logic.

This dep was added to LLVMBuild.txt back in 2018, and presumably it was
carried over into the gn build.

Differential Revision: https://reviews.llvm.org/D87553
The file was modifiedllvm/utils/TableGen/LLVMBuild.txt
The file was modifiedllvm/utils/gn/secondary/llvm/utils/TableGen/BUILD.gn
Commit ad99e34c59b80fd094a6acdbcde4869ff37dac87 by Yuanfang Chen
Revert "[NewPM][CodeGen] Introduce CodeGenPassBuilder to help build codegen pipeline"

This reverts commit 31ecf8d29d81d196374a562c6d2bd2c25a62861e.
This reverts commit 3fdaa8602a086a3fca5f0fc8527536ac659079d0.

There is laying violation for Target->CodeGen.
The file was removedllvm/lib/CodeGen/CodeGenPassBuilder.cpp
The file was removedllvm/include/llvm/CodeGen/MachinePassRegistry.def
The file was removedllvm/include/llvm/CodeGen/CodeGenPassBuilder.h
The file was modifiedllvm/lib/CodeGen/LLVMTargetMachine.cpp
The file was modifiedllvm/lib/CodeGen/TargetPassConfig.cpp
The file was removedllvm/include/llvm/CodeGen/CGPassBuilderOption.h
The file was modifiedllvm/include/llvm/Passes/StandardInstrumentations.h
The file was modifiedllvm/include/llvm/Target/TargetMachine.h
The file was modifiedllvm/lib/CodeGen/CMakeLists.txt
Commit 0e0d93e2f09a3e84cee0e77f0f2510001c2f064a by llvmgnsyncbot
[gn build] Port ad99e34c59b
The file was modifiedllvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn