SuccessChanges

Summary

  1. [JSON] Allow emitting comments in json::OStream (details)
  2. [lld-macho] cleanup unimplemented-option warnings (details)
  3. [X86] Add a memory clobber to the bittest intrinsic inline asm. Get default clobbers from the target (details)
  4. [lld-macho] handle options -search_paths_first, -search_dylibs_first (details)
  5. [JSON] Facility to track position within an object and report errors. (details)
  6. [NewPM][MSSA] Fix failures under NPM due to -enable-mssa-loop-dependency (details)
  7. [NewPM][CGSCC] Handle newly added functions in updateCGAndAnalysisManagerForPass (details)
  8. [NewPM] Add callbacks to PassBuilder to run before/after parsing a pass (details)
  9. [JSON] Display errors associated with Paths in context (details)
Commit 140b7b6f09ca01f89701ccc86ddd8553cf42c311 by sam.mccall
[JSON] Allow emitting comments in json::OStream

This isn't standard JSON, but is a popular extension.
It will be used to show errors in context, rendering pseudo-json for humans.

Differential Revision: https://reviews.llvm.org/D88103
The file was modifiedllvm/lib/Support/JSON.cpp (diff)
The file was modifiedllvm/include/llvm/Support/JSON.h (diff)
The file was modifiedllvm/unittests/Support/JSONTest.cpp (diff)
Commit fa5f9452120cc1691d23e272697695a5a4331f9c by gkm
[lld-macho] cleanup unimplemented-option warnings

Remove all spurious `HelpHidden` flags from  `lld/MachO/Options.td`. Add test for `HelpHidden` to `warnIfUnimplementedOption()` so that the empty `// handled elsewhere` case is unnecessary.

Reviewed By: #lld-macho, int3, smeenai

Differential Revision: https://reviews.llvm.org/D88160
The file was modifiedlld/MachO/Options.td (diff)
The file was modifiedlld/MachO/Driver.cpp (diff)
Commit d9717d8ee7143f4f5b768dfb5e8629ecfa067e39 by craig.topper
[X86] Add a memory clobber to the bittest intrinsic inline asm. Get default clobbers from the target

I believe the inline asm emitted here should have a memory clobber since it writes to memory.

It was also missing the dirflag clobber that we use by default along with flags and fpsr. To avoid missing defaults in the future, get the default list from the target

Differential Revision: https://reviews.llvm.org/D88121
The file was modifiedclang/test/CodeGen/bittest-intrin.c (diff)
The file was modifiedclang/lib/CodeGen/CGBuiltin.cpp (diff)
Commit 8f2c31f22b974da2c0fbc5de0ce4dceffe8ed0b8 by gkm
[lld-macho] handle options -search_paths_first, -search_dylibs_first

Differential Revision: https://reviews.llvm.org/D88054
The file was modifiedlld/MachO/Config.h (diff)
The file was modifiedlld/MachO/Options.td (diff)
The file was modifiedlld/test/MachO/link-search-order.s (diff)
The file was modifiedlld/MachO/Driver.cpp (diff)
Commit 16619e7139bdcb0021598ba76cb5cf30ac669dbb by sam.mccall
[JSON] Facility to track position within an object and report errors.

This error model should be rich enough for most applications. It comprises:

- a name for the root object, so the user knows what we're parsing
- a path from the root object to the JSON node most associated with the error
- a local error message

This can be presented as an llvm::Error e.g.
  "expected string at ConfigFile.credentials[0].username"

It's designed to be cheap: Paths are a linked list of lightweight
objects on the stack. No heap allocations unless errors are encountered.

A subsequent commit will make use of this in the JSON-to-object
translation facilities: fromJSON and ObjectMapper.
However it's independent of these and can be used for e.g. validation alone.

Another subsequent commit will support showing the error in its context
within the parsed value.

Differential Revision: https://reviews.llvm.org/D88103
The file was modifiedllvm/unittests/Support/JSONTest.cpp (diff)
The file was modifiedllvm/lib/Support/JSON.cpp (diff)
The file was modifiedllvm/include/llvm/Support/JSON.h (diff)
Commit 6700b9de1637fd9888dfe9628157d2aeb6d9f526 by aeubanks
[NewPM][MSSA] Fix failures under NPM due to -enable-mssa-loop-dependency

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D88128
The file was modifiedllvm/test/Transforms/LICM/read-only-calls.ll (diff)
The file was modifiedllvm/test/Transforms/LICM/atomics.ll (diff)
The file was modifiedllvm/test/Transforms/LICM/promote-order.ll (diff)
The file was modifiedllvm/test/Transforms/LICM/store-hoisting.ll (diff)
The file was modifiedllvm/test/Transforms/LICM/argmemonly-call.ll (diff)
The file was modifiedllvm/test/Analysis/BasicAA/store-promote.ll (diff)
Commit 6b1ce83a1238815899cf18f69bbc0eb37679a410 by aeubanks
[NewPM][CGSCC] Handle newly added functions in updateCGAndAnalysisManagerForPass

This seems to fit the CGSCC updates model better than calling
addNewFunctionInto{Ref,}SCC() on newly created/outlined functions.
Now addNewFunctionInto{Ref,}SCC() are no longer necessary.

However, this doesn't work on newly outlined functions that aren't
referenced by the original function. e.g. if a() was outlined into b()
and c(), but c() is only referenced by b() and not by a(), this will
trigger an assert.

This also fixes an issue I was seeing with newly created functions not
having passes run on them.

Ran check-llvm with expensive checks.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D87798
The file was modifiedllvm/include/llvm/Analysis/LazyCallGraph.h (diff)
The file was modifiedllvm/lib/Transforms/Coroutines/CoroSplit.cpp (diff)
The file was modifiedllvm/lib/Transforms/Utils/CallGraphUpdater.cpp (diff)
The file was modifiedllvm/lib/Analysis/CGSCCPassManager.cpp (diff)
The file was modifiedllvm/lib/Analysis/LazyCallGraph.cpp (diff)
The file was modifiedllvm/unittests/Analysis/CGSCCPassManagerTest.cpp (diff)
The file was modifiedllvm/unittests/Analysis/LazyCallGraphTest.cpp (diff)
Commit 111aa4e36614d9a056cf5040d4d7bbfddeb9ebb2 by aeubanks
[NewPM] Add callbacks to PassBuilder to run before/after parsing a pass

This is in preparation for supporting -debugify-each, which adds a debug
info pass before and after each pass.

Switch VerifyEach to use this.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D88107
The file was modifiedllvm/lib/Passes/PassBuilder.cpp (diff)
The file was modifiedllvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp (diff)
The file was modifiedllvm/tools/opt/NewPMDriver.cpp (diff)
The file was modifiedpolly/lib/Support/RegisterPasses.cpp (diff)
The file was modifiedllvm/include/llvm/Passes/PassBuilder.h (diff)
The file was modifiedllvm/unittests/IR/PassBuilderCallbacksTest.cpp (diff)
Commit 38de1c33a8374bb16abfb024a973d851c170bafc by sam.mccall
[JSON] Display errors associated with Paths in context

When an error occurs processing a JSON object, seeing the actual
surrounding data helps. Dumping just the node where the problem
was identified can be too much or too little information.

printErrorContext() shows the error message in its context, as a comment.
JSON values along the path to the broken place are shown in some detail,
the rest of the document is elided. For example:

```
{
  "credentials": [
    {
      "username": /* error: expected string */ 42,
      "password": "secret"
    },
    { ... }
  ]
  "backups": { ... }
}
```

Differential Revision: https://reviews.llvm.org/D88103
The file was modifiedllvm/unittests/Support/JSONTest.cpp (diff)
The file was modifiedllvm/lib/Support/JSON.cpp (diff)
The file was modifiedllvm/include/llvm/Support/JSON.h (diff)