Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5499f46e authored by Yi Kong's avatar Yi Kong Committed by Automerger Merge Worker
Browse files

Merge "Tweak ThinLTO inling heuristics in absense of PGO profile" am: 76a5ba81 am: 280fdb96

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1433954

Change-Id: Id01257725269cb35a1585bd83679cb444bb5b316
parents 0dc5152f 280fdb96
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -117,12 +117,11 @@ func (lto *lto) flags(ctx BaseModuleContext, flags Flags) Flags {
			flags.Local.LdFlags = append(flags.Local.LdFlags, cachePolicyFormat+policy)
		}

		// If the module does not have a profile, be conservative and do not inline
		// or unroll loops during LTO, in order to prevent significant size bloat.
		// If the module does not have a profile, be conservative and limit cross TU inline
		// limit to 5 LLVM IR instructions, to balance binary size increase and performance.
		if !ctx.isPgoCompile() {
			flags.Local.LdFlags = append(flags.Local.LdFlags,
				"-Wl,-plugin-opt,-inline-threshold=0",
				"-Wl,-plugin-opt,-unroll-threshold=0")
				"-Wl,-plugin-opt,-import-instr-limit=5")
		}
	}
	return flags