AbortedChanges

Summary

  1. [ARM] Add tests for fmin/max with largest/smallest float (NFC) (details)
  2. [CGP] Prevent optimizePhiType from iterating forever (details)
  3. [DAGCombiner] Propagate FMF flags in FMA folding (details)
  4. [ASTImporter] Add basic support for comparing Stmts and compare function bodies (details)
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/test/CodeGen/PowerPC/fma-combine.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
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