SuccessChanges

Summary

  1. [ARM] Added more patterns to generate SSAT/USAT with shift (details)
  2. [llvm] Fix unused variable in non-debug configurations (details)
  3. [ARM][LowOverheadLoops] Cleanup and re-arrange (details)
  4. [AMDGPU] Reformat AMDGPUTargetLowering::isSDNodeAlwaysUniform. NFC. (details)
  5. [clang][codegen] Annotate `correctly-rounded-divide-sqrt-fp-math` fn-attr for OpenCL only. (details)
  6. Revert "Add the ability to write target stop-hooks using the ScriptInterpreter." (details)
  7. [clangd] Add a trained DecisionForest for code completion. (details)
  8. [ubsan] nullability-arg: Fix crash on C++ member pointers (details)
  9. [unittests] Preserve LD_LIBRARY_PATH in crash recovery test (details)
  10. [AArch64] Reuse map iterator instead of double lookup. NFC (details)
  11. Add FunctionType to MLIR C and Python bindings. (details)
  12. [clangd] Use Decision Forest to score code completions. (details)
  13. [InstCombine] Add basic trunc(shr(trunc(x),c)) tests (details)
  14. [GlobalISel] Combine (xor (and x, y), y) -> (and (not x), y) (details)
  15. [AArch64][GlobalISel] Support shifted register form in emitTST (details)
  16. [CostModel] split handling of intrinsics from other calls (details)
Commit 675431b9878776e3c919b79162774a9cdabdaa4c by meera.nakrani
[ARM] Added more patterns to generate SSAT/USAT with shift

Added patterns to generate an SSAT or USAT with shift for
SSAT/USAT instructions that are matched from IR patterns.

Differential Revision: https://reviews.llvm.org/D88145
The file was modifiedllvm/lib/Target/ARM/ARMInstrThumb2.td
The file was modifiedllvm/lib/Target/ARM/ARMInstrInfo.td
The file was modifiedllvm/test/CodeGen/ARM/usat-with-shift.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-satmul-loops.ll
The file was modifiedllvm/test/CodeGen/ARM/ssat-with-shift.ll
Commit 509fba75dff2382b867f5962e02fb0a899a5fa18 by tpopp
[llvm] Fix unused variable in non-debug configurations
The file was modifiedllvm/lib/Target/ARM/MVETailPredication.cpp
Commit e82a0084d322948b94a5ca3213237d5eeab4920f by sam.parker
[ARM][LowOverheadLoops] Cleanup and re-arrange

Rename and reorganise how we decide where to put the LoopStart
instruction.
The file was modifiedllvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
Commit 0e0a0c8d2ce4945c3c14d2805ff264c407143423 by jay.foad
[AMDGPU] Reformat AMDGPUTargetLowering::isSDNodeAlwaysUniform. NFC.
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
Commit 5dbf80cad9556e222c4383960007fc0b27ea9541 by michael.hliao
[clang][codegen] Annotate `correctly-rounded-divide-sqrt-fp-math` fn-attr for OpenCL only.

- `-cl-fp32-correctly-rounded-divide-sqrt` is an OpenCL-specific option
  and `correctly-rounded-divide-sqrt-fp-math` should be added for OpenCL
  at most.

Differential revision: https://reviews.llvm.org/D88303
The file was modifiedclang/test/CodeGen/complex-libcalls.c
The file was modifiedclang/test/CodeGen/complex-builtins.c
The file was modifiedclang/test/CodeGen/math-builtins.c
The file was modifiedclang/test/CodeGen/math-libcalls.c
The file was modifiedclang/lib/CodeGen/CGCall.cpp
Commit f775fe59640a2e837ad059a8f40e26989d4f9831 by Jonas Devlieghere
Revert "Add the ability to write target stop-hooks using the ScriptInterpreter."

This temporarily reverts commit b65966cff65bfb66de59621347ffd97238d3f645
while Jim figures out why the test is failing on the bots.
The file was removedlldb/test/Shell/Commands/Inputs/stop_hook.py
The file was modifiedlldb/docs/use/python-reference.rst
The file was modifiedlldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
The file was modifiedlldb/source/Commands/CommandObjectTarget.cpp
The file was modifiedlldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
The file was removedlldb/test/Shell/Commands/command-stop-hook-output.test
The file was modifiedlldb/test/API/commands/target/stop-hooks/main.c
The file was modifiedlldb/include/lldb/Target/Target.h
The file was modifiedlldb/bindings/python/python-swigsafecast.swig
The file was removedlldb/test/API/commands/target/stop-hooks/stop_hook.py
The file was modifiedlldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
The file was modifiedlldb/test/API/commands/target/stop-hooks/TestStopHooks.py
The file was modifiedlldb/include/lldb/Interpreter/ScriptInterpreter.h
The file was modifiedlldb/source/Commands/Options.td
The file was modifiedlldb/include/lldb/Symbol/SymbolContext.h
The file was modifiedlldb/source/Target/Target.cpp
The file was modifiedlldb/bindings/python/python-wrapper.swig
The file was removedlldb/test/API/commands/target/stop-hooks/TestStopHookScripted.py
The file was modifiedlldb/source/Symbol/SymbolContext.cpp
Commit b5f7e9e26cd06d034bf68f63de6ae6d37b032b5e by usx
[clangd] Add a trained DecisionForest for code completion.

Replaces the dummy CodeCompletion model with a trained DecisionForest
model.
The features.json needs to be manually curated specifying the features
to be used. This is a one-time cost and does not change if the model
changes until we decide to add/remove features.

Differential Revision: https://reviews.llvm.org/D88071
The file was modifiedclang-tools-extra/clangd/quality/model/forest.json
The file was modifiedclang-tools-extra/clangd/quality/model/features.json
Commit 06bc685fa2400cc28282ab6dd3c917d45bfa662f by Vedant Kumar
[ubsan] nullability-arg: Fix crash on C++ member pointers

Extend -fsanitize=nullability-arg to handle call sites which accept C++
member pointers.

rdar://62476022

Differential Revision: https://reviews.llvm.org/D88336
The file was modifiedclang/lib/CodeGen/CGExpr.cpp
The file was addedclang/test/CodeGenCXX/ubsan-nullability-arg.cpp
The file was modifiedclang/lib/CodeGen/CGCall.cpp
The file was modifiedclang/lib/CodeGen/CodeGenFunction.h
Commit 07b7a24e3fe86fe64ba5a56629cb290f3bd3b86d by mikhail.maltsev
[unittests] Preserve LD_LIBRARY_PATH in crash recovery test

We need to preserve the LD_LIBRARY_PATH environment variable when
spawning a child process (certain setups rely on non-standard paths
for e.g. libstdc++). In order to achieve this, set
LLVM_CRC_UNIXCRCRETURNCODE in the parent process instead of creating
the child's environment from scratch.

Reviewed By: aganea

Differential Revision: https://reviews.llvm.org/D88308
The file was modifiedllvm/unittests/Support/CrashRecoveryTest.cpp
Commit 37ef2255b6422b8e0b93f0becd340e041047a2aa by jonathan_roelofs
[AArch64] Reuse map iterator instead of double lookup. NFC
The file was modifiedllvm/lib/Target/AArch64/AArch64SIMDInstrOpt.cpp
Commit 76753a597b5d9bf4addf19399ae30c4b3870a4a6 by stellaraccident
Add FunctionType to MLIR C and Python bindings.

Differential Revision: https://reviews.llvm.org/D88416
The file was modifiedmlir/test/Bindings/Python/ir_types.py
The file was modifiedmlir/include/mlir-c/StandardTypes.h
The file was modifiedmlir/lib/CAPI/IR/StandardTypes.cpp
The file was modifiedmlir/test/CAPI/ir.c
The file was modifiedmlir/lib/Bindings/Python/IRModules.cpp
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/tool/ClangdMain.cpp
The file was modifiedclang-tools-extra/clangd/Quality.h
The file was modifiedclang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
The file was modifiedclang-tools-extra/clangd/CodeComplete.h
The file was modifiedclang-tools-extra/clangd/Quality.cpp
The file was modifiedclang-tools-extra/clangd/CodeComplete.cpp
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
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-xor-of-and-with-same-reg.mir
The file was modifiedllvm/include/llvm/Target/GlobalISel/Combine.td
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
The file was modifiedllvm/lib/Target/AArch64/AArch64Combine.td
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
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
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