SuccessChanges

Summary

  1. [AMDGPU] Reformat AMDGPUTargetLowering::isSDNodeAlwaysUniform. NFC. (details)
  2. [clang][codegen] Annotate `correctly-rounded-divide-sqrt-fp-math` fn-attr for OpenCL only. (details)
  3. Revert "Add the ability to write target stop-hooks using the ScriptInterpreter." (details)
  4. [clangd] Add a trained DecisionForest for code completion. (details)
  5. [ubsan] nullability-arg: Fix crash on C++ member pointers (details)
  6. [unittests] Preserve LD_LIBRARY_PATH in crash recovery test (details)
  7. [AArch64] Reuse map iterator instead of double lookup. NFC (details)
  8. Add FunctionType to MLIR C and Python bindings. (details)
  9. [clangd] Use Decision Forest to score code completions. (details)
  10. [InstCombine] Add basic trunc(shr(trunc(x),c)) tests (details)
  11. [GlobalISel] Combine (xor (and x, y), y) -> (and (not x), y) (details)
  12. [AArch64][GlobalISel] Support shifted register form in emitTST (details)
  13. [CostModel] split handling of intrinsics from other calls (details)
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/lib/CodeGen/CGCall.cpp
The file was modifiedclang/test/CodeGen/complex-builtins.c
The file was modifiedclang/test/CodeGen/complex-libcalls.c
The file was modifiedclang/test/CodeGen/math-libcalls.c
The file was modifiedclang/test/CodeGen/math-builtins.c
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 modifiedlldb/test/API/commands/target/stop-hooks/main.c
The file was removedlldb/test/API/commands/target/stop-hooks/stop_hook.py
The file was modifiedlldb/include/lldb/Interpreter/ScriptInterpreter.h
The file was modifiedlldb/docs/use/python-reference.rst
The file was removedlldb/test/Shell/Commands/command-stop-hook-output.test
The file was modifiedlldb/source/Commands/Options.td
The file was removedlldb/test/Shell/Commands/Inputs/stop_hook.py
The file was modifiedlldb/include/lldb/Symbol/SymbolContext.h
The file was modifiedlldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
The file was modifiedlldb/source/Target/Target.cpp
The file was modifiedlldb/bindings/python/python-wrapper.swig
The file was modifiedlldb/include/lldb/Target/Target.h
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/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
The file was modifiedlldb/source/Symbol/SymbolContext.cpp
The file was removedlldb/test/API/commands/target/stop-hooks/TestStopHookScripted.py
The file was modifiedlldb/bindings/python/python-swigsafecast.swig
The file was modifiedlldb/source/Commands/CommandObjectTarget.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 addedclang/test/CodeGenCXX/ubsan-nullability-arg.cpp
The file was modifiedclang/lib/CodeGen/CGCall.cpp
The file was modifiedclang/lib/CodeGen/CodeGenFunction.h
The file was modifiedclang/lib/CodeGen/CGExpr.cpp
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/include/mlir-c/StandardTypes.h
The file was modifiedmlir/lib/Bindings/Python/IRModules.cpp
The file was modifiedmlir/test/CAPI/ir.c
The file was modifiedmlir/test/Bindings/Python/ir_types.py
The file was modifiedmlir/lib/CAPI/IR/StandardTypes.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/Quality.cpp
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.h
The file was modifiedclang-tools-extra/clangd/tool/ClangdMain.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 modifiedllvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
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
The file was modifiedllvm/include/llvm/Target/GlobalISel/Combine.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/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/opt-fold-compare.mir
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

Summary

  1. [HACK] Disable matrix_types tests. (details)
  2. [RISCV] Add a toolchain file for RISC-V. (details)
  3. [RISCV] get toolchain path from enviroment variable (details)
  4. Disable the reference result for the aarch64_neon_intrinsics.c test since clang is buggy. (details)
Commit a9efc190f2a5c0735562c014211bfce35706d5bd by Amara Emerson
[HACK] Disable matrix_types tests.
The file was modifiedSingleSource/UnitTests/matrix-types-spec.cpp (diff)
Commit 8141fe6213d911f469f92bfe5f8a85672f9d8a3d by Amara Emerson
[RISCV] Add a toolchain file for RISC-V.
The file was addedcmake/caches/target-riscv64-linux.cmake
Commit f9af83f302b397d59361f0dd72f2b55171535901 by Amara Emerson
[RISCV] get toolchain path from enviroment variable
The file was modifiedcmake/caches/target-riscv64-linux.cmake (diff)
Commit 87d67af9d8565d068b6706c081b7ae07addcb882 by Amara Emerson
Disable the reference result for the aarch64_neon_intrinsics.c test since clang is buggy.

Benign changes in -O0 codegen is causing the known non-deterministic failure
modes because clang is doing the wrong thing w.r.t saturating intrinsics.

Until someone goes and fixes the underlying issue, this test is only useful
as a compile-time test.

Ref: D59615 and b5e87c9ef2243ecd65e0ef87a1bf303c0c26db04 discussions.
The file was removedSingleSource/UnitTests/Vector/AArch64/aarch64_neon_intrinsics.reference_output