SuccessChanges

Summary

  1. Add FunctionType to MLIR C and Python bindings. (details)
  2. [clangd] Use Decision Forest to score code completions. (details)
  3. [InstCombine] Add basic trunc(shr(trunc(x),c)) tests (details)
  4. [GlobalISel] Combine (xor (and x, y), y) -> (and (not x), y) (details)
  5. [AArch64][GlobalISel] Support shifted register form in emitTST (details)
  6. [CostModel] split handling of intrinsics from other calls (details)
Commit 76753a597b5d9bf4addf19399ae30c4b3870a4a6 by stellaraccident
Add FunctionType to MLIR C and Python bindings.

Differential Revision: https://reviews.llvm.org/D88416
The file was modifiedmlir/include/mlir-c/StandardTypes.h (diff)
The file was modifiedmlir/lib/Bindings/Python/IRModules.cpp (diff)
The file was modifiedmlir/test/CAPI/ir.c (diff)
The file was modifiedmlir/test/Bindings/Python/ir_types.py (diff)
The file was modifiedmlir/lib/CAPI/IR/StandardTypes.cpp (diff)
Commit a8b55b6939a5962d5b2bf1a57980562d6f3045e5 by usx
[clangd] Use Decision Forest to score code completions.

By default clangd will score a code completion item using heuristics model.

Scoring can be done by Decision Forest model by passing `--ranking_model=decision_forest` to
clangd.

Features omitted from the model:
- `NameMatch` is excluded because the final score must be multiplicative in `NameMatch` to allow rescoring by the editor.
- `NeedsFixIts` is excluded because the generating dataset that needs 'fixits' is non-trivial.

There are multiple ways (heuristics) to combine the above two features with the prediction of the DF:
- `NeedsFixIts` is used as is with a penalty of `0.5`.

Various alternatives of combining NameMatch `N` and Decision forest Prediction `P`
- N * scale(P, 0, 1): Linearly scale the output of model to range [0, 1]
- N * a^P:
  - More natural: Prediction of each Decision Tree can be considered as a multiplicative boost (like NameMatch)
  - Ordering is independent of the absolute value of P. Order of two items is proportional to `a^{difference in model prediction score}`. Higher `a` gives higher weightage to model output as compared to NameMatch score.

Baseline MRR = 0.619
MRR for various combinations:
N * P = 0.6346, advantage%=2.5768
N * 1.1^P = 0.6600, advantage%=6.6853
N * **1.2**^P = 0.6669, advantage%=**7.8005**
N * **1.3**^P = 0.6668, advantage%=**7.7795**
N * **1.4**^P = 0.6659, advantage%=**7.6270**
N * 1.5^P = 0.6646, advantage%=7.4200
N * 1.6^P = 0.6636, advantage%=7.2671
N * 1.7^P = 0.6629, advantage%=7.1450
N * 2^P = 0.6612, advantage%=6.8673
N * 2.5^P = 0.6598, advantage%=6.6491
N * 3^P = 0.6590, advantage%=6.5242
N * scaled[0, 1] = 0.6465, advantage%=4.5054

Differential Revision: https://reviews.llvm.org/D88281
The file was modifiedclang-tools-extra/clangd/CodeComplete.cpp (diff)
The file was modifiedclang-tools-extra/clangd/tool/ClangdMain.cpp (diff)
The file was modifiedclang-tools-extra/clangd/Quality.h (diff)
The file was modifiedclang-tools-extra/clangd/unittests/CodeCompleteTests.cpp (diff)
The file was modifiedclang-tools-extra/clangd/Quality.cpp (diff)
The file was modifiedclang-tools-extra/clangd/CodeComplete.h (diff)
Commit ad4f11a9d38339848318b4a476a8d3d53a7d1f3f by llvm-dev
[InstCombine] Add basic trunc(shr(trunc(x),c)) tests

Helps improve the minor regressions noticed on D88316
The file was addedllvm/test/Transforms/InstCombine/trunc-shift-trunc.ll
Commit a52e78012a548c231fb8cba81861f6ffb2246726 by Jessica Paquette
[GlobalISel] Combine (xor (and x, y), y) -> (and (not x), y)

When we see this:

```
%and = G_AND %x, %y
%xor = G_XOR %and, %y
```

Produce this:

```
%not = G_XOR %x, -1
%new_and = G_AND %not, %y
```

as long as we are guaranteed to eliminate the original G_AND.

Also matches all commuted forms. E.g.

```
%and = G_AND %y, %x
%xor = G_XOR %y, %and
```

will be matched as well.

Differential Revision: https://reviews.llvm.org/D88104
The file was modifiedllvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp (diff)
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h (diff)
The file was modifiedllvm/include/llvm/Target/GlobalISel/Combine.td (diff)
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-xor-of-and-with-same-reg.mir
The file was modifiedllvm/lib/Target/AArch64/AArch64Combine.td (diff)
Commit f55a5186c6c005fe171a35a832000829cd00cd2a by Jessica Paquette
[AArch64][GlobalISel] Support shifted register form in emitTST

Support emitting ANDSXrs and ANDSWrs in `emitTST`. Update opt-fold-compare.mir
to show that it works.

Differential Revision: https://reviews.llvm.org/D87530
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/opt-fold-compare.mir (diff)
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp (diff)
Commit 1121a583b8875d7c621f32b3a42498986c0617d9 by spatel
[CostModel] split handling of intrinsics from other calls

This should be close to NFC (no-functional-change), but I
can't completely rule out that some call on some target
travels down a different path. There's an especially large
amount of code spaghetti in this part of the cost model.

The goal is to clean up the intrinsic cost handling so
we can canonicalize to the new min/max intrinsics without
causing regressions.
The file was modifiedllvm/include/llvm/Analysis/TargetTransformInfoImpl.h (diff)