26 Commits

Author SHA1 Message Date
Stephen Tozer
094572701d
[RemoveDIs] Print IR with debug records by default (#91724)
This patch makes the final major change of the RemoveDIs project, changing the
default IR output from debug intrinsics to debug records. This is expected to
break a large number of tests: every single one that tests for uses or
declarations of debug intrinsics and does not explicitly disable writing
records. 

If this patch has broken your downstream tests (or upstream tests on a
configuration I wasn't able to run):
1. If you need to immediately unblock a build, pass
`--write-experimental-debuginfo=false` to LLVM's option processing for all
failing tests (remember to use `-mllvm` for clang/flang to forward arguments to
LLVM).
2. For most test failures, the changes are trivial and mechanical, enough that
they can be done by script; see the migration guide for a guide on how to do
this: https://llvm.org/docs/RemoveDIsDebugInfo.html#test-updates
3. If any tests fail for reasons other than FileCheck check lines that need
updating, such as assertion failures, that is most likely a real bug with this
patch and should be reported as such.

For more information, see the recent PSA:
https://discourse.llvm.org/t/psa-ir-output-changing-from-debug-intrinsics-to-debug-records/79578
2024-06-14 15:07:27 +01:00
OCHyams
de6da6ad55 Reapply D146987 "[Assignment Tracking] Enable by default"
See https://discourse.llvm.org/t/rfc-enable-assignment-tracking/69399

This sets the -Xclang -fexperimental-assignment-tracking flag to the value
enabled which means it will be enabled so long as none of the following are
true: it's an LTO build, LLDB debugger tuning has been specified, or it's an O0
build (no work is done in any case if -g is not specified or -gmlt is used).

This reverts commit 9e7f14a8211c82dca64bd6b22d1c450d4c6d3e5b which reverts
https://reviews.llvm.org/D146987
2023-06-13 12:43:46 +01:00
Fangrui Song
9e7f14a821 Revert "Reapply D146987 "[Assignment Tracking] Enable by default""
This reverts commit 8dec295af0352fccb5825dc08e4ec21cb9ffe010.

See https://github.com/llvm/llvm-project/issues/62838
2023-05-22 08:53:15 -07:00
OCHyams
8dec295af0 Reapply D146987 "[Assignment Tracking] Enable by default"
See https://discourse.llvm.org/t/rfc-enable-assignment-tracking/69399

This sets the -Xclang -fexperimental-assignment-tracking flag to the value
enabled which means it will be enabled so long as none of the following are
true: it's an LTO build, LLDB debugger tuning has been specified, or it's an O0
build (no work is done in any case if -g is not specified or -gmlt is used).

This reverts commit 0ba922f600469df273c753f873668e41025487c0 which reverts
https://reviews.llvm.org/D146987
2023-04-28 11:34:53 +01:00
Carlos Alberto Enciso
0ba922f600 Revert "Reapply D146987 "[Assignment Tracking] Enable by default""
This reverts commit b74aeaccbae876ca348aa87a3db05d444052ae65.
Note: The author (Orlando) asked to revert this commit.
2023-04-21 09:11:40 +01:00
OCHyams
b74aeaccba Reapply D146987 "[Assignment Tracking] Enable by default"
See https://discourse.llvm.org/t/rfc-enable-assignment-tracking/69399

This sets the -Xclang -fexperimental-assignment-tracking flag to the value
enabled which means it will be enabled so long as none of the following are
true: it's an LTO build, LLDB debugger tuning has been specified, or it's an O0
build (no work is done in any case if -g is not specified or -gmlt is used).

This reverts commit a65ca4546b9ee042d6c40149d3f820893edbd766 which reverts
https://reviews.llvm.org/D146987
2023-04-20 15:08:01 +01:00
OCHyams
a65ca4546b Revert D146987 "[Assignment Tracking] Enable by default"
This reverts commit 89d27854ec7f5e8bd83e72fa574740bf3d06355b.

See https://reviews.llvm.org/D146987 for issues.
2023-04-19 19:16:40 +01:00
OCHyams
89d27854ec Reapply D146987 "[Assignment Tracking] Enable by default"
This reverts commit 7674ae7231c4e286b93eb399e475765630666f8b which
reverts D146987.

See https://reviews.llvm.org/D146987 for issues.
2023-04-19 14:15:58 +01:00
OCHyams
7674ae7231 Revert D146987 "[Assignment Tracking] Enable by default"
This reverts commit 107b307bd61e51aa66ea41f1a2c92c1459b39c7e due
to build errors in a parent commit fca3e8e024f0015604d21e6f76f3e199345679c5
2023-04-19 10:03:32 +01:00
OCHyams
107b307bd6 Reapply D146987 "[Assignment Tracking] Enable by default"
This reverts commit efc8b52cbd942f4bd5ffe8f64da5fb8a3b7adc32
which reverts D146987.

See https://reviews.llvm.org/D146987 for issues.
2023-04-19 09:32:09 +01:00
Fangrui Song
efc8b52cbd Revert D146987 "[Assignment Tracking] Enable by default"
This reverts commit 3820e9a2b29a2e268319ed6635da0d59e18d736d.

See https://reviews.llvm.org/D146987 for issues.
2023-04-12 15:01:04 -07:00
OCHyams
3820e9a2b2 Reapply (4) "[Assignment Tracking] Enable by default"
Re-land D146987.

This reverts commit 8af575657b1dc1113640286b3649842c2473c2cf
which reverts D146987.
2023-04-12 12:35:17 +01:00
OCHyams
8af575657b Revert (4) "[Assignment Tracking] Enable by default"
This reverts commit a0525f09ac1eda3fbb74e8708b3aa5b7379df0c2 which
lands D146987.

Buildbot: https://lab.llvm.org/buildbot/#/builders/70/builds/36214
2023-04-11 22:25:16 +01:00
OCHyams
a0525f09ac Reapply (3) "[Assignment Tracking] Enable by default"
Re-land D146987.

This reverts commit 4f1954ed67c12aca3fd3e67151185c64dc941768 which
reverts D146987.
2023-04-11 21:15:03 +01:00
OCHyams
4f1954ed67 Revert (3) "[Assignment Tracking] Enable by default"
Revert D146987.

This reverts commit f11e1475c97c1ba6b418838f3592de930677c3d0 which
reapplies D146987.

Buildbot: https://lab.llvm.org/buildbot/#/builders/70/builds/36103
2023-04-09 11:21:55 +01:00
OCHyams
f11e1475c9 Reapply (2) "[Assignment Tracking] Enable by default"
Re-land D146987.

This reverts commit 64fba207a683a355d9059cd57adb8a139c2f5dda
which reverts D146987.
2023-04-09 09:59:26 +01:00
OCHyams
64fba207a6 Revert (2) "[Assignment Tracking] Enable by default"
Revert D146987 for the 2nd time.

This reverts commit 91a0740474e3c4fe0bde8ff5699115bf808ca23f

Buildbot: https://lab.llvm.org/buildbot/#/builders/70/builds/36007
2023-04-06 16:32:58 +01:00
OCHyams
91a0740474 Reapply "[Assignment Tracking] Enable by default"
Re-land D146987.

This reverts commit 43825d19318695be48abe6f042369da00fbb808b (revert)
which reverts aa32490bfe0b957c4f5583e14304f5e34b2b9bce (original commit).
2023-04-06 15:29:18 +01:00
Haowei Wu
43825d1931 Revert "[Assignment Tracking] Enable by default"
This reverts commit aa32490bfe0b957c4f5583e14304f5e34b2b9bce, which
breaks llvm runtimes builds on armv7 linux.
2023-03-31 11:27:18 -07:00
OCHyams
aa32490bfe [Assignment Tracking] Enable by default
See https://discourse.llvm.org/t/rfc-enable-assignment-tracking/69399

This sets the `-Xclang -fexperimental-assignment-tracking` flag to the value
`enabled` which means it will be enabled so long as none of the following are
true: it's an LTO build, LLDB debugger tuning has been specified, or it's an O0
build (no work is done in any case if -g is not specified or -gmlt is used).

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D146987
2023-03-31 12:38:48 +01:00
OCHyams
78b0689ff2 [Assignment Tracking] Follow up for D147129 - fix broken clang tests
D147129 causes the assignment tracking pass to skip optnone functions, which
ends up overriding the "-fexperimental-assignment-tracking=forced" option at
O0. Add -disable-O0-optnone to the tests so that optnone doesn't interfere.

Buildbot example: https://lab.llvm.org/buildbot/#/builders/216/builds/18986
2023-03-29 13:54:10 +01:00
OCHyams
41c92c0dc6 [Assignment Tracking] Give -fexperimental-assignment-tracking flag 3 options
Without this patch assignment tracking is enabled with
`-fexperimental-assignment-tracking` and disabled with
`-fno-experimental-assignment-tracking` (default). This patch removes the
`-fno-` version and changes `-fexperimental-assignment-tracking` to take 3
values: `enabled`, `disabled` (default), and `forced`.

`clang -Xclang -fexperimental-assignment-tracking=enabled` enables the feature
if some other conditions are met and `=forced` enables it without any further
checks.

If `enabled` is specified the feature will remain disabled if any of the
following are true: it's an LTO or ThinLTO build, optimisations are not
enabled, or lldb debugger tuning has been specified. See this short RFC
for more info:
https://discourse.llvm.org/t/rfc-enable-assignment-tracking/69399

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D146615
2023-03-29 12:47:54 +01:00
OCHyams
0a996c82a7 [Assignment Tracking] Fix -fexperimental-assignment-tracking cc1 flag
This change allows `-fexperimental-assignment-tracking` to be negated using the
negative equivalent `-fno-experimental-assignment-tracking`, and fixes the flag
so that the default behaviour can be changed (currently the default is still
false / disabled).

Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D142029
2023-01-20 14:36:16 +00:00
OCHyams
4b6b2b1a42 Reapply: [Assignment Tracking][7/*] Add assignment tracking functionality to clang
Reverted in 98fa95492f3bbd5befdeb36c88a3ac5ef2740b4e.

The Assignment Tracking debug-info feature is outlined in this RFC:

https://discourse.llvm.org/t/
rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir

This patch plumbs the AssignmentTrackingPass (AKA declare-to-assign), added in
the previous patch in this set, into the optimisation pipeline from
clang. clang/test/CodeGen/assignment-tracking/assignment-tracking.cpp is the
main test for this patch.

Note: while clang (with the help of the declare-to-assign pass) can now emit
Assignment Tracking metadata, the llvm middle and back ends don't yet
understand it.

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D132226
2022-11-09 09:28:41 +00:00
OCHyams
98fa95492f Revert "[Assignment Tracking][7/*] Add assignment tracking functionality to clang"
This reverts commit 28f9636edd7d4e5f3eba1e3d0d37ec53d616481f.

Bot failure: https://lab.llvm.org/buildbot/#/builders/109/builds/50251
2022-11-08 18:43:05 +00:00
OCHyams
28f9636edd [Assignment Tracking][7/*] Add assignment tracking functionality to clang
The Assignment Tracking debug-info feature is outlined in this RFC:

https://discourse.llvm.org/t/
rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir

This patch plumbs the AssignmentTrackingPass (AKA declare-to-assign), added in
the previous patch in this set, into the optimisation pipeline from
clang. clang/test/CodeGen/assignment-tracking/assignment-tracking.cpp is the
main test for this patch.

Note: while clang (with the help of the declare-to-assign pass) can now emit
Assignment Tracking metadata, the llvm middle and back ends don't yet
understand it.

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D132226
2022-11-08 17:49:08 +00:00