FailedChanges

Summary

  1. Revert "Add the ability to write target stop-hooks using the ScriptInterpreter." (details)
  2. [clangd] Add a trained DecisionForest for code completion. (details)
  3. [ubsan] nullability-arg: Fix crash on C++ member pointers (details)
  4. [unittests] Preserve LD_LIBRARY_PATH in crash recovery test (details)
  5. [AArch64] Reuse map iterator instead of double lookup. NFC (details)
  6. Add FunctionType to MLIR C and Python bindings. (details)
  7. [clangd] Use Decision Forest to score code completions. (details)
  8. [InstCombine] Add basic trunc(shr(trunc(x),c)) tests (details)
  9. [GlobalISel] Combine (xor (and x, y), y) -> (and (not x), y) (details)
  10. [AArch64][GlobalISel] Support shifted register form in emitTST (details)
  11. [CostModel] split handling of intrinsics from other calls (details)
  12. [CostModel] move early exit for free intrinsics (details)
  13. [AArch64][GlobalISel] Infer whether G_PHI is going to be a FPR in regbankselect (details)
  14. [WebAssembly] Use wasm::Signature for in ObjectWriter (NFC) (details)
  15. [InstCombine] Add trunc(shr(trunc(x),c)) non-uniform vector tests (details)
  16. [AddressSanitizer] Copy type metadata to prevent miscompilation (details)
  17. [clangd] Rename evaluate() to evaluateHeuristics() (details)
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/TestStopHooks.py
The file was modifiedlldb/docs/use/python-reference.rst
The file was removedlldb/test/API/commands/target/stop-hooks/stop_hook.py
The file was modifiedlldb/source/Commands/Options.td
The file was modifiedlldb/source/Symbol/SymbolContext.cpp
The file was modifiedlldb/test/API/commands/target/stop-hooks/main.c
The file was modifiedlldb/include/lldb/Interpreter/ScriptInterpreter.h
The file was removedlldb/test/API/commands/target/stop-hooks/TestStopHookScripted.py
The file was removedlldb/test/Shell/Commands/command-stop-hook-output.test
The file was modifiedlldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
The file was modifiedlldb/source/Target/Target.cpp
The file was modifiedlldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
The file was modifiedlldb/include/lldb/Symbol/SymbolContext.h
The file was modifiedlldb/bindings/python/python-wrapper.swig
The file was modifiedlldb/bindings/python/python-swigsafecast.swig
The file was modifiedlldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
The file was removedlldb/test/Shell/Commands/Inputs/stop_hook.py
The file was modifiedlldb/include/lldb/Target/Target.h
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/features.json
The file was modifiedclang-tools-extra/clangd/quality/model/forest.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/CGCall.cpp
The file was addedclang/test/CodeGenCXX/ubsan-nullability-arg.cpp
The file was modifiedclang/lib/CodeGen/CGExpr.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/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/include/mlir-c/StandardTypes.h
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/CodeComplete.h
The file was modifiedclang-tools-extra/clangd/Quality.h
The file was modifiedclang-tools-extra/clangd/CodeComplete.cpp
The file was modifiedclang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
The file was modifiedclang-tools-extra/clangd/tool/ClangdMain.cpp
The file was modifiedclang-tools-extra/clangd/Quality.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/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
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/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
Commit 745abbbb852e3c0006f22b7beade820ac978252c by spatel
[CostModel] move early exit for free intrinsics

This should be NFC unless some target was expecting that
some form of cttz/ctlz/memcpy is free in terms of size/latency
but not free in throughput cost.
The file was modifiedllvm/include/llvm/CodeGen/BasicTTIImpl.h
Commit 9d7ec46f5740d7626171c2b8198f825176991e0a by Jessica Paquette
[AArch64][GlobalISel] Infer whether G_PHI is going to be a FPR in regbankselect

Some instructions (G_LOAD, G_SELECT, G_UNMERGE_VALUES) check if their uses
will define/use FPRs (using `onlyUsesFP` and `onlyDefinesFP`).

The register bank of a use isn't necessarily known when an instruction asks for
this.

Teach `hasFPConstraints` to look at the instructions feeding into a G_PHI when
its destination bank is unknown. If any of them are FPR, assume the entire
G_PHI will also be assigned a FPR.

Since a phi can have many inputs, and those inputs can in turn be phis,
restrict the search depth to a very low number.

Also improve the docs for `hasFPConstraints` and friends a little.

This is a 0.3% code size improvement on CTMark/Bullet at -O3, and a 0.2% code
size improvement at CTMark/pairlocalalign at -O3.

Differential Revision: https://reviews.llvm.org/D88177
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.h
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/regbank-fp-use-def.mir
Commit 4c41fb5ad70caeda7f03f0049fb1dff9934dfc53 by aheejin
[WebAssembly] Use wasm::Signature for in ObjectWriter (NFC)

There are two `WasmSignature` structs, one in
include/llvm/BinaryFormat/Wasm.h and the other in
lib/MC/WasmObjectWriter.cpp. I don't know why they got separated in this
way in the first place, but it seems we can unify them to use the one in
Wasm.h for all cases.

Reviewed By: dschuff, sbc100

Differential Revision: https://reviews.llvm.org/D88428
The file was modifiedllvm/lib/MC/WasmObjectWriter.cpp
Commit d047bb1cf69316b39dd67ecc5af669414be9152c by llvm-dev
[InstCombine] Add trunc(shr(trunc(x),c)) non-uniform vector tests
The file was modifiedllvm/test/Transforms/InstCombine/trunc-shift-trunc.ll
Commit 06e68f05dafb96ea5395d2fed669fccdcd07f61f by d.c.ddcc
[AddressSanitizer] Copy type metadata to prevent miscompilation

When ASan and e.g. Dead Virtual Function Elimination are enabled, the
latter will rely on type metadata to determine if certain virtual calls can be
removed. However, ASan currently does not copy type metadata, which can cause
virtual function calls to be incorrectly removed.

Differential Revision: https://reviews.llvm.org/D88368
The file was modifiedllvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
The file was modifiedllvm/test/Instrumentation/AddressSanitizer/debug_info.ll
Commit 9b1666f3ce2b02be70f8e7f82c3ec5c81262010b by usx
[clangd] Rename evaluate() to evaluateHeuristics()

Since we have 2 scoring functions (heuristics and decision forest),
renaming the existing evaluate() function to be more descriptive of the
Heuristics being evaluated in it.

Differential Revision: https://reviews.llvm.org/D88431
The file was modifiedclang-tools-extra/clangd/Quality.h
The file was modifiedclang-tools-extra/clangd/FindSymbols.cpp
The file was modifiedclang-tools-extra/clangd/unittests/QualityTests.cpp
The file was modifiedclang-tools-extra/clangd/CodeComplete.cpp
The file was modifiedclang-tools-extra/clangd/XRefs.cpp
The file was modifiedclang-tools-extra/clangd/index/dex/Dex.cpp
The file was modifiedclang-tools-extra/clangd/Quality.cpp