FailedChanges

Summary

  1. PR50402: Use proper constant evaluation rules for checking constraint (details)
  2. -fno-semantic-interposition: Don't set dso_local on GlobalVariable (details)
  3. [test] Fix test (details)
  4. [mlir] Add a new `print-ir-after-failure` IR pass printing flag (details)
  5. [mlir] Refactor the implementation of pass crash reproducers (details)
Commit 2f8ac0758bbfad72e52ef8602fbbd796e1347784 by richard
PR50402: Use proper constant evaluation rules for checking constraint
satisfaction.

Previously we used the rules for constant folding in a non-constant
context, meaning that we'd incorrectly accept foldable non-constant
expressions and that std::is_constant_evaluated() would evaluate to
false.
The file was modifiedclang/test/SemaTemplate/cxx2a-constraint-caching.cpp
The file was modifiedclang/test/SemaTemplate/instantiate-requires-clause.cpp
The file was modifiedclang/test/SemaTemplate/concepts.cpp
The file was modifiedclang/lib/Sema/SemaConcept.cpp
Commit 37561ba89b7de57bd8ff5ae0691d02604885d4ee by i
-fno-semantic-interposition: Don't set dso_local on GlobalVariable

`clang -fpic -fno-semantic-interposition` may set dso_local on variables for -fpic.

GCC folks consider there are 'address interposition' and 'semantic interposition',
and 'disabling semantic interposition' can optimize function calls but
cannot change variable references to use local aliases
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100483).

This patch removes dso_local for variables in
`clang -fpic -fno-semantic-interposition` mode so that the built shared objects can
work with copy relocations. Building llvm-project tiself with
-fno-semantic-interposition (D102453) should now be safe with trunk Clang.

Example:
```
// a.c
int var;
int *addr() { return var; }

// old: cannot be interposed
movslq  .Lvar$local(%rip), %rax
// new: can be interposed
movq    var@GOTPCREL(%rip), %rax
movslq  (%rax), %rax
```

The local alias lowering for `GlobalVariable`s is kept in case there is a
future option allowing local aliases.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D102583
The file was modifiedclang/test/CodeGenCUDA/device-var-linkage.cu
The file was modifiedclang/test/CodeGenCUDA/static-device-var-rdc.cu
The file was modifiedclang/lib/CodeGen/CodeGenModule.cpp
The file was modifiedclang/test/CodeGenCUDA/managed-var.cu
The file was modifiedclang/test/CodeGen/attr-weakref2.c
The file was modifiedclang/test/OpenMP/declare_target_only_one_side_compilation.cpp
The file was modifiedclang/test/CodeGen/SystemZ/builtins-systemz-zvector-constrained.c
The file was modifiedclang/test/CodeGen/semantic-interposition.c
The file was modifiedclang/test/CodeGenCUDA/device-stub.cu
Commit ac06f6d06de408c00923708dd8a795b6ba9d23d7 by i
[test] Fix test
The file was modifiedclang/test/CodeGenOpenCLCXX/addrspace-constructors.clcpp
Commit 64ce90e1af5c38822b7730bb6f21ed3d99f2f364 by riddleriver
[mlir] Add a new `print-ir-after-failure` IR pass printing flag

This flag will print the IR after a pass only in the case where the pass failed. This can be useful to more easily view the invalid IR, without needing to print after every pass in the pipeline.

Differential Revision: https://reviews.llvm.org/D101853
The file was modifiedmlir/lib/Pass/IRPrinting.cpp
The file was modifiedmlir/include/mlir/Pass/PassManager.h
The file was modifiedmlir/test/lib/Pass/TestPassManager.cpp
The file was modifiedmlir/test/Pass/ir-printing.mlir
The file was modifiedmlir/docs/PassManagement.md
The file was modifiedmlir/lib/Pass/PassManagerOptions.cpp
Commit 92469ca027b2e794aa9162931665b379445ca711 by riddleriver
[mlir] Refactor the implementation of pass crash reproducers

The current implementation has several key limitations and weirdness, e.g local reproducers don't support dynamic pass pipelines, error messages don't include the passes that failed, etc. This revision refactors the implementation to support more use cases, and also be much cleaner.

The main change in this revision, aside from moving the implementation out of Pass.cpp and into its own file, is the addition of a crash recovery pass instrumentation. For local reproducers, this instrumentation handles setting up the recovery context before executing each pass. For global reproducers, the instrumentation is used to provide a more detailed error message, containing information about which passes are running and on which operations.

Example of new message:

```
error: Failures have been detected while processing an MLIR pass pipeline
note: Pipeline failed while executing [`TestCrashRecoveryPass` on 'module' operation: @foo]: reproducer generated at `crash-recovery.mlir.tmp`
```

Differential Revision: https://reviews.llvm.org/D101854
The file was modifiedmlir/lib/Pass/Pass.cpp
The file was modifiedmlir/include/mlir/Pass/PassManager.h
The file was modifiedmlir/lib/Pass/CMakeLists.txt
The file was modifiedmlir/test/Pass/crash-recovery.mlir
The file was addedmlir/lib/Pass/PassCrashRecovery.cpp
The file was modifiedmlir/lib/Pass/PassDetail.h
The file was modifiedmlir/docs/PassManagement.md