1. [SLP] simplify reduction matching (details)
  2. Recommit "[RISCV] Legalize select when Zbt extension available" (details)
  3. ADT: Fix reference invalidation in SmallVector::emplace_back and assign(N,V) (details)
  4. Remove deprecated methods from OpState. (details)
Commit d77753381fe024434ae8ffaaacfe4b9ed9d4d760 by spatel
[SLP] simplify reduction matching

This is NFC-intended and removes the "OperationData"
class which had become nothing more than a recurrence
(reduction) type.

I adjusted the matching logic to distinguish
instructions from non-instructions - that's all that
the "IsLeafValue" member was keeping track of.
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Commit 4ab0f51a7518332b8b7691915b5fdad4c1ed045f by craig.topper
Recommit "[RISCV] Legalize select when Zbt extension available"

This recommits 71ed4b6ce57d8843ef705af8f98305976a8f107a with
the polarity of some of the pattern corrected.

Original commit message:
The custom expansion of select operations in the RISC-V backend
interferes with the matching of cmov instructions. Legalizing
select when the Zbt extension is available solves that problem.

Reviewed By: luismarques, craig.topper

Differential Revision:
The file was modifiedllvm/test/CodeGen/RISCV/rv32Zbt.ll
The file was modifiedllvm/test/CodeGen/RISCV/select-bare.ll
The file was modifiedllvm/test/CodeGen/RISCV/select-const.ll
The file was modifiedllvm/test/CodeGen/RISCV/rv32Zbs.ll
The file was modifiedllvm/test/CodeGen/RISCV/select-and.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
The file was modifiedllvm/test/CodeGen/RISCV/select-optimize-multiple.ll
The file was modifiedllvm/test/CodeGen/RISCV/select-or.ll
The file was modifiedllvm/test/CodeGen/RISCV/rv32Zbb.ll
The file was modifiedllvm/test/CodeGen/RISCV/rv64Zbt.ll
The file was modifiedllvm/test/CodeGen/RISCV/select-cc.ll
The file was modifiedllvm/lib/Target/RISCV/
The file was modifiedllvm/test/CodeGen/RISCV/rv32Zbbp.ll
Commit d7ff0036463fbf049a240fe3792fcfcd8081c41e by Duncan P. N. Exon Smith
ADT: Fix reference invalidation in SmallVector::emplace_back and assign(N,V)

This fixes the final (I think?) reference invalidation in `SmallVector`
that we need to fix to align with `std::vector`. (There is still some
left in the range insert / append / assign, but the standard calls that
UB for `std::vector` so I think we don't care?)

For POD-like types, reimplement `emplace_back()` in terms of
`push_back()`, taking a copy even for large `T` rather than lose the
realloc optimization in `grow_pod()`.

For other types, split the grow operation in three and construct the new
element in the middle.

- `mallocForGrow()` calculates the new capacity and returns the result
  of `safe_malloc()`. We only need a single definition per
  `SmallVectorBase` so this is defined in SmallVector.cpp to avoid code
  size bloat. Moving this part of non-POD grow to the source file also
  allows the logic to be easily shared with `grow_pod`, and
  `report_size_overflow()` and `report_at_maximum_capacity()` can move
  there too.
- `moveElementsForGrow()` moves elements from the old to the new
- `takeAllocationForGrow()` frees the old allocation and saves the
  new allocation and capacity .

`SmallVector:assign(size_type, const T&)` also uses the split-grow
operations for non-POD, but it also has a semantic change when not
growing. Previously, assign would start with `clear()`, and so the old
elements were destructed and all elements of the new vector were
copy-constructed (potentially invalidating references). The new
implementation skips destruction and uses copy-assignment for the prefix
of the new vector that fits. The new semantics match what libc++ does
for `std::vector::assign()`.

Note that the following is another possible implementation:
  void assign(size_type NumElts, ValueParamT Elt) {
    std::fill_n(this->begin(), std::min(NumElts, this->size()), Elt);
    this->resize(NumElts, Elt);
The downside of this simpler implementation is that if the vector has to
grow there will be `size()` redundant copy operations.

(I had planned on splitting this patch up into three for committing
(after getting performance numbers / initial review), but I've realized
that if this does for some reason need to be reverted we'll probably
want to revert the whole package...)

Differential Revision:
The file was modifiedllvm/include/llvm/ADT/SmallVector.h
The file was modifiedllvm/lib/Support/SmallVector.cpp
The file was modifiedllvm/unittests/ADT/SmallVectorTest.cpp
Commit 8827e07aaf2114b7f09e229e22481cd58137ea6a by csigg
Remove deprecated methods from OpState.

Reviewed By: rriddle

Differential Revision:
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
The file was modifiedmlir/lib/IR/Operation.cpp