SuccessChanges

Summary

  1. [Docs] Fix --print-supported-cpus option rendering (details)
  2. [llvm-cov gcov] Improve accuracy when some edges are not measured (details)
  3. [gcov] Assign names to some types and loaded values used in @__llvm_internal* (details)
  4. [gcov] Add spanning tree optimization (details)
  5. [gcov] Fix memory leak due to BranchProbabilityInfoWrapperPass (details)
  6. Reland "[PowerPC] Implement instruction clustering for stores" (details)
  7. [X86] Add test cases for PR11210 (details)
  8. [ARM] Add tests for fmin/max with largest/smallest float (NFC) (details)
  9. [CGP] Prevent optimizePhiType from iterating forever (details)
  10. [DAGCombiner] Propagate FMF flags in FMA folding (details)
  11. [ASTImporter] Add basic support for comparing Stmts and compare function bodies (details)
Commit 0fb2203cd6c287e7438b7ac2571645066c63eeb6 by joker.eph
[Docs] Fix --print-supported-cpus option rendering

Adds link/code sample to avoid rendering two dashes as non-ASCII "en dash".
Also make wording a complete sentence.

Reviewed By: nickdesaulniers, tmfink

Differential Revision: https://reviews.llvm.org/D85596
The file was modifiedclang/docs/CommandGuide/clang.rst
Commit 8cf1ac97cec654923b4f80ad11506bf06ec34f65 by i
[llvm-cov gcov] Improve accuracy when some edges are not measured

Also guard against infinite recursion if GCOV_ARC_ON_TREE edges contain a cycle.
The file was modifiedllvm/test/tools/llvm-cov/gcov-8.c
The file was modifiedllvm/include/llvm/ProfileData/GCOV.h
The file was modifiedcompiler-rt/test/profile/gcov-basic.c
The file was modifiedllvm/lib/ProfileData/GCOV.cpp
Commit f086e85eea94a51eb42115496ac5d24f07bc8791 by i
[gcov] Assign names to some types and loaded values used in @__llvm_internal*

This makes the generated IR much more readable.
The file was modifiedclang/test/CodeGen/code-coverage.c
The file was modifiedllvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
Commit 63182c2ac0b643a60d397274e8a31166fc7243fa by i
[gcov] Add spanning tree optimization

gcov is an "Edge Profiling with Edge Counters" application according to
Optimally Profiling and Tracing Programs (1994).

The minimum number of counters necessary is |E|-(|V|-1). The unmeasured edges
form a spanning tree. Both GCC --coverage and clang -fprofile-generate leverage
this optimization. This patch implements the optimization for clang --coverage.
The produced .gcda files are much smaller now.
The file was addedllvm/test/Transforms/GCOVProfiling/split-indirectbr-critical-edges.ll
The file was modifiedcompiler-rt/test/profile/gcov-dump-and-remove.c
The file was modifiedclang/test/CodeGen/code-coverage-tsan.c
The file was modifiedllvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
The file was modifiedcompiler-rt/test/profile/Posix/gcov-fork.c
The file was modifiedllvm/test/Transforms/GCOVProfiling/atomic-counter.ll
Commit 5f4e9bf6416e45eba483a4e5e263749989fdb3b3 by i
[gcov] Fix memory leak due to BranchProbabilityInfoWrapperPass

This is weird.
The file was modifiedllvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
Commit bec81dc67d9348dad0ea60a9b8804d1413aefe98 by qiucofan
Reland "[PowerPC] Implement instruction clustering for stores"

Commit 3c0b3250 introduced store fusion for PowerPC target, but it
brought failure under UB sanitizer and was reverted. This patch fixes
them.
The file was modifiedllvm/lib/Target/PowerPC/PPCSubtarget.h
The file was modifiedllvm/lib/Target/PowerPC/PPC.td
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrInfo.h
The file was modifiedllvm/lib/Target/PowerPC/PPCTargetMachine.cpp
The file was addedllvm/test/CodeGen/PowerPC/fusion-load-store.ll
The file was modifiedllvm/test/CodeGen/PowerPC/pcrel-call-linkage-leaf.ll
The file was modifiedllvm/lib/Target/PowerPC/PPCSubtarget.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrInfo.cpp
Commit e2dee9af8db645fd3c0351da91d3cb09c1dcdd5d by llvm-dev
[X86] Add test cases for PR11210

Demonstrates that redundant masked stores may be removed, as long as we're able to replace the AVX/AVX2 masked store with a generic masked store (constant mask or sign-extended bool vector mask).
The file was addedllvm/test/Transforms/PhaseOrdering/X86/masked-memory-ops.ll
Commit 2c85f5e642fb599f77aac0de22316c922cfd7cbb by nikita.ppv
[ARM] Add tests for fmin/max with largest/smallest float (NFC)
The file was modifiedllvm/test/CodeGen/ARM/fminmax-folds.ll
Commit 9237fde48139400764377eb73e7e5d3bc5b7fffc by david.green
[CGP] Prevent optimizePhiType from iterating forever

The recently added optimizePhiType algorithm had no checks to make sure
it didn't continually iterate backward and forth between float and int
types. This means that given an input like store(phi(bitcast(load))), we
could convert that back and forth to store(bitcast(phi(load))). This
particular case would usually have been simplified to a different load
type (folding the bitcast into the load) before CGP, but other cases can
occur. The one that came up was phi(bitcast(phi)), where the two phi's
of different types were bitcast between. That was not helped by a dead
bitcast being kept around which could make conversion look profitable.

This adds an extra check of the bitcast Uses or Defs, to make sure that
at least one is grounded and will not end up being converted back. It
also makes sure that dead bitcasts are removed, and there is a minor
change to include newly created Phi nodes in the Visited set so that
they do not need to be revisited.

Differential Revision: https://reviews.llvm.org/D82676
The file was modifiedllvm/test/CodeGen/AArch64/convertphitype.ll
The file was modifiedllvm/lib/CodeGen/CodeGenPrepare.cpp
Commit a4c535198643d1541b19f37a468c885a7baa7605 by qiucofan
[DAGCombiner] Propagate FMF flags in FMA folding

DAG combiner folds (fma a 1.0 b) into (fadd a b) but the flag isn't
propagated into new fadd. This patch fixes that.

Some code in visitFMA is redundant and such support for vector constants
is missing. Need follow-up patch to clean.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D87037
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
The file was modifiedllvm/test/CodeGen/PowerPC/fma-combine.ll
Commit c0bcd11068fc13e45b253c6c315882097f94c121 by Raphael Isemann
[ASTImporter] Add basic support for comparing Stmts and compare function bodies

Right now the ASTImporter assumes for most Expr nodes that they are always equal
which leads to non-compatible declarations ending up being merged. This patch
adds the basic framework for comparing Stmts (and with that also Exprs) and
implements the custom checks for a few Stmt subclasses. I'll implement the
remaining subclasses in follow up patches (mostly because there are a lot of
subclasses and some of them require further changes like having GNU language in
the testing framework)

The motivation for this is that in LLDB we try to import libc++ source code and
some of the types we are importing there contain expressions (e.g. because they
use `enable_if<expr>`), so those declarations are currently merged even if they
are completely different (e.g. `enable_if<value> ...` and `enable_if<!value>
...` are currently considered equal which is clearly not true).

Reviewed By: martong, balazske

Differential Revision: https://reviews.llvm.org/D87444
The file was modifiedclang/lib/AST/ASTStructuralEquivalence.cpp
The file was modifiedclang/include/clang/AST/ASTStructuralEquivalence.h
The file was modifiedclang/unittests/AST/StructuralEquivalenceTest.cpp