Relands this feature after several fixes:
* Force fake uses to be emitted before musttail calls (#136867)
* Added soften-float legalization for fake uses (#142714)
* Treat fake uses as size-less instructions in a SystemZ assert (#144390)
If further issues with fake uses are found then this may be reverted again,
but all currently-known issues are resolved.
This reverts commit 2dc6e98169baeb1f73036da0ea50fd828d8323d0.
Reverted following several issues appearing related to fake uses, reported
on the github PR.
This reverts commit a9dff35ad251cd20376ab25b26d1e5394e18ff4c.
Recently, a new flag -fextend-variable-liveness was added that prevents
optimizations from removing the values of source variables in some cases,
improving the quality of debugging for optimized builds where it is
enabled.
Following the inclusion of the flag, this patch enables it by default
when `-Og` is set. Currently, `-Og` is equivalent to `-O1` - it is
effectively just an alias. By enabling `-fextend-lifetimes`, this patch
changes the code generated by Clang with `-Og` to have reduced
optimization and greater debuggability than `-O1`, differentiating the
two according to their respective purposes. This idea was discussed
previously on Discourse where there was general agreement with the
principle of this change:
https://discourse.llvm.org/t/rfc-redefine-og-o1-and-add-a-new-level-of-og
This patch contains a number of changes relating to the above flag;
primarily it updates comment references to the old flag names,
"-fextend-lifetimes" and "-fextend-this-ptr" to refer to the new names,
"-fextend-variable-liveness[={all,this}]". These changes are all NFC.
This patch also removes the explicit -fextend-this-ptr-liveness flag
alias, and shortens the help-text for the main flag; these are both
changes that were meant to be applied in the initial PR (#110000), but
due to some user-error on my part they were not included in the merged
commit.
Following the commit that added the fake use intrinsic to LLVM, this patch
adds a pair of flags for the clang frontend that emit fake use intrinsics,
for the purpose of extending the lifetime of variables (either all source
variables, or just the `this` pointer). This patch does not implement the
fake use intrinsic emission of the flags themselves, it simply adds the flags,
the corresponding release note, and the attachment of the `has_fake_uses`
attribute to affected functions; the remaining functionality appears in the
next patch.
Co-authored-by: Stephen Tozer <stephen.tozer@sony.com>