Commit graph

14 commits

Author SHA1 Message Date
Colin Cross
e00614ecba Fix TestAfdoDeps for darwin
LTO does not set the -import-instr-limit flag when building for
darwin, don't test it on darwin host modules.

Test: afdo_test.go
Change-Id: I83f77006a875f8b0a6af9ae11eb3bad88b0681b1
2024-02-09 12:22:13 -08:00
Colin Cross
15fa814560 Disable more of AFDO for host modules
afdo.addDep would never add a depencency on a profile for a host
module, but afdoDepsMutator would still propagate AfdoRDeps to
dependencies, afdoMutator would still create afdo variants, and
afdo.flags would still add the -funique-internal-linkage-names
flag.  Exit early from all of these functions, since the afdo
variations will never be useful.

Test: afdo_test.go
Change-Id: I255fcbb86c99871916e571fbc74075d918b24745
2024-02-07 15:49:47 -08:00
Colin Cross
da4c89f750 Add more AFDO tests
Add more coverage to the afdo tests for the arm32 variant of a module
that only has an arm64 profile, for the -funique-internal-linkage-names
flag, and for the interaction between LTO linker flags and AFDO.

Test: afdo_test.go
Change-Id: I3ed4ce033c2431ea3e2fee536744b5e5b4cad296
2024-02-07 15:48:13 -08:00
Ke-Yu Lu
0be9d6034e Revert "Convert AFDO mutators to TransitionMutator"
Revert submission 2925209

Reason for revert: b/323975183

Reverted changes: /q/submissionid:2925209

Change-Id: Ie907d23081817d601a1a2083347b5f683829a36c
2024-02-06 02:15:03 +00:00
Colin Cross
a6b407fbf5 Convert AFDO mutators to TransitionMutator
Convert afdoDepsMutator and afdoMutator to a TransitionMutator as a
step towards variants-on-demand.

Bug: 319288033
Test: afdo_test.go
Change-Id: Ib05845455ccf43a07b3915a0d7b0a95896062f13
2024-01-26 11:08:32 -08:00
Yabin Cui
01c4456ce2 Enable -funique-internal-linkage-names when afdo=true
We used to enable unique names only when a profile is available.
But A profile generated for a binary without unique names doesn't
work well when building a binary with unique names. To avoid a
chicken-and-egg problem, this CL enables the flag when afdo=true,
whether a profile exists or not.

Bug: 241523910
Test: build
Change-Id: I74d834510d81d2db76e34d0488c74a60e1fcecd5
2023-04-21 14:41:55 -07:00
Vinh Tran
cde1016aff Reimplement afdo support for rust
Ignore-AOSP-First: The parent CL is internal
Bug: 267229065
Test: go test
Change-Id: Ia14679285b92f3f14ff269392a61f978c71311b2
Merged-In: Ia14679285b92f3f14ff269392a61f978c71311b2
2023-03-31 17:55:16 -04:00
Vinh Tran
44cb78c988 Implement fdo_profile module type
Introducing fdo_profile module type to reimplement the afdo support in cc moduels. This change allows the feature to be compatible with Bazel migration.

How it works:

PreDepsMutators:
  * BeginMutator: If non-static cc modules sets afdo prop, search and add corresponding fdo_profile module as a dep with fdoProfileTag
  * fdoProfileMutator:
    * If in fdo_profile module, set FdoProfileProvider with full path to profile
    * If in cc module, read FdoProfileProvider from dep with fdoProfileTag and set FdoProfileInfo.Path to FdoProfilePath field

PostDepsMutators:
  * afdoDepsMutator: If a module has FdoProfilePath set, walk to its static deps and set itself to the deps' AfdoRdeps
  * afdoMutator: If a static dep has AfdoRDeps set, create afdo variant.

Ignore-AOSP-First: Other CLs in the same topic are internal-only
Test: go test
Bug: b/267229065
Change-Id: I687d798a02d9743c92804fea36fb4ae3a7a0e5e3
Merged-In: I687d798a02d9743c92804fea36fb4ae3a7a0e5e3
2023-03-31 17:52:01 -04:00
Vinh Tran
2e7b0fd271 Add tests to verify more use cases of afdo in cc and rust
Test: go test
Bug: 267229065
Change-Id: I4aa9538e92aa27e0f842bdce3725bc82739196cb
2023-03-27 14:01:40 -04:00
Treehugger Robot
463c15de15 Merge "Make more cc tests parallel" 2022-12-20 19:38:58 +00:00
Vinh Tran
9c6080cc4b Add Soong test to verify runtime_deps doesn't have afdo variant
Test: go test
Change-Id: If6ef4f5ee529b322a251b11ebdceca4bbcacdd63
2022-12-15 15:31:31 +00:00
Liz Kammer
7c5d1591bc Make more cc tests parallel
Test: go test soong cc tests
Change-Id: I5ade33b1579ae46571728e051471147e627a7d38
2022-12-05 13:43:29 -05:00
Liz Kammer
8c8e8d5207 Add more afdo testing
Test: go test soong cc tests
Change-Id: If7b812962f5dfbf51c799225356862cbaea33e5d
2022-12-02 10:40:43 -05:00
Yi Kong
d5954a2a92 Add tests for afdo.go
Bug: 79161490
Test: presubmit
Change-Id: I686b5226aad5011ab30a0a105f8c7866cd610502
2022-01-26 17:46:33 +08:00