Changes

Summary

  1. [AMDGPU] Enable copy between VGPR and AGPR classes during regalloc (details)
  2. [DebugInfo] Do not replace existing nodes from DICompileUnit (details)
  3. [mlir][python] Add pyi stub files to enable auto completion. (details)
  4. [mlir][python] Implement more SymbolTable methods. (details)
  5. [mlir][python] Audit and fix a lot of the Python pyi stubs. (details)
  6. [X86][clang] Enable floating-point type for -mno-x87 option on 32-bits (details)
Commit 5297cbf04532f61fe18570982f4f2a3095d08c13 by Christudasan.Devadasan
[AMDGPU] Enable copy between VGPR and AGPR classes during regalloc

Greedy register allocator prefers to move a constrained
live range into a larger allocatable class over spilling
them. This patch defines the necessary superclasses for
vector registers. For subtargets that support copy between
VGPRs and AGPRs, the vector register spills during regalloc
now become just copies.

Reviewed By: rampitec, arsenm

Differential Revision: https://reviews.llvm.org/D109301
The file was modifiedllvm/test/CodeGen/AMDGPU/spill-vgpr-to-agpr.ll
The file was modifiedllvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
The file was modifiedllvm/lib/Target/AMDGPU/SIRegisterInfo.h
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.cpp
The file was addedllvm/test/CodeGen/AMDGPU/spill-vector-superclass.ll
The file was addedllvm/test/CodeGen/AMDGPU/partial-regcopy-and-spill-missed-at-regalloc.ll
The file was addedllvm/test/CodeGen/AMDGPU/vector-spill-restore-to-other-vector-type.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/spill-agpr.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/extend-phi-subrange-not-in-parent.mir
Commit 0150645bf5ae0d55866e77d2bec5aad4e5226b7c by kyulee
[DebugInfo] Do not replace existing nodes from DICompileUnit

When creating a new DIBuilder with an existing DICompileUnit, load the
DINodes from the current DICompileUnit so they don't get overwritten.
This is done in the MachineOutliner pass, but it didn't change the CU so
the bug never appeared. We need this if we ever want to add DINodes to
the CU after it has been created, e.g., DIGlobalVariables.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D114556
The file was modifiedllvm/unittests/IR/IRBuilderTest.cpp
The file was modifiedllvm/lib/IR/DIBuilder.cpp
Commit a6e7d024a9ebda1564fd78b829c45169add80864 by stellaraccident
[mlir][python] Add pyi stub files to enable auto completion.

There is no completely automated facility for generating stubs that are both accurate and comprehensive for native modules. After some experimentation, I found that MyPy's stubgen does the best at generating correct stubs with a few caveats that are relatively easy to fix:
  * Some types resolve to cross module symbols incorrectly.
  * staticmethod and classmethod signatures seem to always be completely generic and need to be manually provided.
  * It does not generate an __all__ which, from testing, causes namespace pollution to be visible to IDE code completion.

As a first step, I did the following:
  * Ran `stubgen` for `_mlir.ir`, `_mlir.passmanager`, and `_mlirExecutionEngine`.
  * Manually looked for all instances where unnamed arguments were being emitted (i.e. as 'arg0', etc) and updated the C++ side to include names (and re-ran stubgen to get a good initial state).
  * Made/noted a few structural changes to each `pyi` file to make it minimally functional.
  * Added the `pyi` files to the CMake rules so they are installed and visible.

To test, I added a `.env` file to the root of the project with `PYTHONPATH=...` set as per instructions. Then reload the developer window (in VsCode) and verify that completion works for various changes to test cases.

There are still a number of overly generic signatures, but I want to check in this low-touch baseline before iterating on more ambiguous changes. This is already a big improvement.

Differential Revision: https://reviews.llvm.org/D114679
The file was modifiedmlir/lib/Bindings/Python/IRCore.cpp
The file was modifiedmlir/lib/Bindings/Python/Pass.cpp
The file was addedmlir/python/mlir/_mlir_libs/_mlir/ir.pyi
The file was modifiedmlir/lib/Bindings/Python/IRAffine.cpp
The file was addedmlir/python/mlir/_mlir_libs/_mlirExecutionEngine.pyi
The file was modifiedmlir/lib/Bindings/Python/IRAttributes.cpp
The file was modifiedmlir/lib/Bindings/Python/IRTypes.cpp
The file was modifiedmlir/python/CMakeLists.txt
The file was modifiedmlir/lib/Bindings/Python/IRModule.h
The file was addedmlir/python/mlir/_mlir_libs/_mlir/passmanager.pyi
The file was modifiedmlir/lib/Bindings/Python/MainModule.cpp
The file was addedmlir/python/mlir/_mlir_libs/_mlir/__init__.pyi
The file was modifiedmlir/lib/Bindings/Python/ExecutionEngineModule.cpp
Commit bdc3183742f1e996d58bdf23b91966e64ad5e9a3 by stellaraccident
[mlir][python] Implement more SymbolTable methods.

* set_symbol_name, get_symbol_name, set_visibility, get_visibility, replace_all_symbol_uses, walk_symbol_tables
* In integrations I've been doing, I've been reaching for all of these to do both general IR manipulation and module merging.
* I don't love the replace_all_symbol_uses underlying APIs since they necessitate SYMBOL_COUNT walks and have various sharp edges. I'm hoping that whatever emerges eventually for this can still retain this simple API as a one-shot.

Differential Revision: https://reviews.llvm.org/D114687
The file was modifiedmlir/python/mlir/_mlir_libs/_mlir/ir.pyi
The file was modifiedmlir/lib/Bindings/Python/IRModule.h
The file was modifiedmlir/lib/Bindings/Python/IRCore.cpp
The file was modifiedmlir/lib/CAPI/IR/IR.cpp
The file was modifiedmlir/include/mlir-c/IR.h
The file was addedmlir/test/python/ir/symbol_table.py
The file was modifiedmlir/test/python/ir/operation.py
Commit a88bb5b9fee5aee8c25cabad44a257175e384f52 by stellaraccident
[mlir][python] Audit and fix a lot of the Python pyi stubs.

* Classes that are still todo are marked with "# TODO: Auto-generated. Audit and fix."
* Those without this note have been cross-checked with C++ sources and most have been spot checked by hovering in VsCode.

Differential Revision: https://reviews.llvm.org/D114767
The file was modifiedmlir/python/mlir/_mlir_libs/_mlir/passmanager.pyi
The file was modifiedmlir/python/mlir/_mlir_libs/_mlir/ir.pyi
The file was modifiedmlir/python/mlir/_mlir_libs/_mlir/__init__.pyi
The file was modifiedmlir/python/mlir/_mlir_libs/_mlirExecutionEngine.pyi
Commit 42c15c7edf174fc7a45131a1b89ee816fada7633 by pengfei.wang
[X86][clang] Enable floating-point type for -mno-x87 option on 32-bits

We should match GCC's behavior which allows floating-point type for -mno-x87 option on 32-bits. https://godbolt.org/z/KrbhfWc9o

The previous block issues have partially been fixed by D112143.

Reviewed By: asavonic, nickdesaulniers

Differential Revision: https://reviews.llvm.org/D114162
The file was modifiedclang/test/Sema/x86-no-x87.cpp
The file was modifiedclang/lib/Basic/Targets/X86.cpp