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
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
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
Convert afdoDepsMutator and afdoMutator to a TransitionMutator as a
step towards variants-on-demand.
Bug: 319288033
Test: afdo_test.go
Change-Id: Ib05845455ccf43a07b3915a0d7b0a95896062f13
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
Ignore-AOSP-First: The parent CL is internal
Bug: 267229065
Test: go test
Change-Id: Ia14679285b92f3f14ff269392a61f978c71311b2
Merged-In: Ia14679285b92f3f14ff269392a61f978c71311b2
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