[clang][bytecode] Add `Pointer::getRootExpr()` (#216706)
Similarly to `getRootVarDecl()`, returns the expression of the base of
the pointer, if there is such an expression.
[LFI][X86] Enable bundling for the LFI target (#214111)
This enables 32-byte bundling for the LFI x86-64 target, and uses bundle
grouping for existing rewrites where appropriate.
[InstCombine] Use samesign constraints in unsigned known-bits folds (#209675)
Extracted from #209097 during review.
For a non-poison unsigned `icmp samesign`, both operands have the same
sign bit. Propagate a known sign bit between the temporary `KnownBits`
values in `foldICmpUsingKnownBits()` so the existing range folds can use
this constraint.
This enables endpoint folds in both signed halves of the integer range,
for example:
```
icmp samesign ugt i8 %x, 126 -> icmp eq i8 %x, 127
icmp samesign ult i8 %x, 127 -> icmp ne i8 %x, 127
icmp samesign ugt i8 %x, -2 -> icmp eq i8 %x, -1
```
-------------------------------
[34 lines not shown]
[Support] Remove duplicate comments in FoldingSet.cpp (NFC) (#216833)
This patch removes duplicate comments in FoldingSet.cpp.
Corresponding declarations are already documented in FoldingSet.h.
Note that LLVM Coding Standards state:
Don't duplicate the documentation comment in the header file and in
the implementation file. Put the documentation comments for public
APIs into the header file.
[ADT] Remove CRTP from FoldingSet and ContextualFoldingSet (NFC) (#216830)
This patch simplifies FoldingSet by removing CRTP from FoldingSet and
ContextualFoldingSet.
Without this patch, FoldingSetImpl uses CRTP to get FoldingSetInfo, a
custom "vtable", from FoldingSet and ContextualFoldingSet.
With this patch, we put ContextStorage as the base class of
FoldingSetImpl. FoldingSetImpl directly takes FoldingSetTrait as a
template parameter. This allows us to:
- populate FoldingSetInfo for both FoldingSet and
ContextualFoldingSet as a static constexpr variable.
- rely on the empty base optimization (EBO) on ContextStorage so that
FoldingSet incurs no memory overhead.
- turn FoldingSet and ContextualFoldingSet into simple type aliases of
[2 lines not shown]
[flang][cuda] Add option to emit different function name for alloc/free of descriptors (#216841)
This allow to call specialized functions instead of the upstream ones.
[BFI] Solve irreducible SCCs instead of splitting their headers (#215170)
c5a3139ebd0d (2014) approximates irreducible control flow by modelling
an SCC as a loop with multiple headers, and
http://reviews.llvm.org/D10348 re-distributes the loop mass across those
headers in proportion to the backedge mass each one received -- one step
of a power iteration, from an assumed split.
Package the SCC with a single representative and solve it instead.
`solveIrreducibleMass` iterates the SCC's internal chain towards its
dominant eigenvector and reads the member masses, the exits and the
circulating mass off that, so the entries' relative frequencies come out
of the solve. Power iteration rather than a relaxation of `f = e +
f*P`: the mass `e` entering the SCC is unknown here, so there is no
fixed point to relax towards, only a direction. NumHeaders, the
per-header BackedgeMass, getHeaderIndex, the isHeader binary search and
adjustLoopHeaderMass go away with the split.
Relative error against an exact rational solve has improved.
[29 lines not shown]
[lldb] Adopt ProcessAddress in the read memory APIs (NFC) (#214088)
Relevant RFC:
https://discourse.llvm.org/t/rfc-address-spaces-support-in-lldb/91222/
Previous PR #206370 adding the AddressSpace definitions.
- switches the read memory virtuals from lldb::addr_t to const
ProcessAddress & and updates every override. No behavior change
expected.
**Test Plan**
- Depending on the buildbots for all other platforms.
[lldb] Keep DW_OP_fbreg results address-sized (#216641)
DW_OP_fbreg adds its signed displacement as an int64_t, which can widen
a 32-bit frame-base Scalar to 64 bits. Canonicalize the pushed result
using the evaluator's existing generic conversion so subsequent
arithmetic uses the target address width.
Add an i386 regression test that checks 32-bit wrapping and the
resulting APSInt width.
Fixes #211007
[BOLT][AArch64] Add call relaxation pass (#173952)
Add a function call relaxation pass that groups functions into clusters,
each with a maximum size of 128MB. This pass is enabled using the
`--relax-exp` option.
* Within each cluster: function calls do not require relaxation.
* Between clusters: thunks are created at the cluster boundaries to
handle inter-cluster calls. These thunks can be either short or long,
depending on the proximity of the thunk destination. When possible, a
long thunk may be shared by both adjacent clusters.
* Hot functions: if all hot functions (after reordering) fit within a
single cluster (under 128MB), no thunks are needed on the hot path, as
determined by the profile.
* PLT behavior: for the Procedure Linkage Table (PLT), it is currently
assumed that the hottest cluster will be placed adjacent to the PLT, so
[8 lines not shown]
[Driver] Treat -O4 as -O3 in clang::getOptimizationLevel, which is called when building LTO link command (#216450)
#169762 (commit e60a69ab8a9e7) replaced the -O option handling in
`tools::addLTOOptions` with `getOptimizationLevel()`, but
`getOptimizationLevel` doesn't expect -O4, while `addLTOOptions` used to
accept and without diagnostics. Teach `getOptimizationLevel` about -O4
and don't diagnose to revert to the old behavior.
---------
Co-authored-by: Wael Yehia <wyehia at ca.ibm.com>