From adad7b05d2857212c29ae5860491edaefd328bdc Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Wed, 2 Dec 2026 06:17:39 +0100 Subject: [PATCH 1/2] cmake: UnitsState::clearAllUnits off the /GL list (91.7% -> 100%) UnitsState::clearAllUnits (0x0052E7B0) reads 91.7% / 80.0% on main since #238 put its file on the /GL list. It was at 100% from #271 on, and its status line still says so. Off the list it reads 100.0% / 100.0% again; the .cpp is unchanged. The function calls fillMemory_ByteValue once per unit in a loop and once more for the unit layer. The original loads LowLevelMemory into ecx in front of that last call too (0x0052E80E). fillMemory.cpp is on the /GL list, so with clearAllUnits.cpp on it as well MSVC knows that the call leaves ecx alone and drops the load: one instruction less than the original. Its two callers are on the /GL list and no longer see its body. Both read as before: Constructor_UnitsState (0x0053B8B0) 100.0% / 100.0%, setupAllMapSections (0x00512100) 97.9% / 93.0%. Measured with real builds on main 0cea04dbf4 (bundled MSVC1400-SP1, function and data resolvers on locally, reccmp raw / normalised): 100.0 / 100.0 in a small build with OPENSHC_FUNCTION_VISIBILITY_UNITS off and in one with it on (519 files, 529 functions each: every /GL file of main, the two functions of this branch, their callers and callee closures). Co-Authored-By: Claude Fable 5.2 --- cmake/compiler-flags-gl.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/compiler-flags-gl.txt b/cmake/compiler-flags-gl.txt index cb59c23cfb..627129c454 100644 --- a/cmake/compiler-flags-gl.txt +++ b/cmake/compiler-flags-gl.txt @@ -323,7 +323,6 @@ src/OpenSHC/Map/Units/UnitsState/applyTunnelDamageAlongPathPlan.cpp src/OpenSHC/Map/Units/UnitsState/assignNameToUnit.cpp src/OpenSHC/Map/Units/UnitsState/assignPeasantToBuilding.cpp src/OpenSHC/Map/Units/UnitsState/changeUnitType.cpp -src/OpenSHC/Map/Units/UnitsState/clearAllUnits.cpp src/OpenSHC/Map/Units/UnitsState/clearSelectionCountsAndPlayerIDs.cpp src/OpenSHC/Map/Units/UnitsState/computeDistanceToNearestEnemyForLegacyMissions.cpp src/OpenSHC/Map/Units/UnitsState/computeLadderClimbPath.cpp From 9feec7ada9e03c9cf761457fb07b42eb9a36b810 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Wed, 2 Dec 2026 06:17:41 +0100 Subject: [PATCH 2/2] cmake: UnitsState::computeLadderClimbPath off the /GL list (96.9% -> 100% with the units option off) UnitsState::computeLadderClimbPath (0x00533A10) reads 96.9% / 93.8% with OPENSHC_FUNCTION_VISIBILITY_UNITS off since #238 put its file on the /GL list, and 100% with the option on. It was at 100% in #378, and its status line still says so. Off the list it reads 100.0% / 100.0% in both modes; the .cpp is unchanged. The function calls copyData and then fillMemory_ByteValue. The original loads LowLevelMemory into ecx again between the two (0x00533A69). With the option on, copyData.cpp is a member of a wrapper unit and off the /GL list, so MSVC cannot see that it leaves ecx alone, and the load is there. With the option off both files were under /GL and the load went. Eight functions call it. The seven Update* functions among them are on the /GL list and no longer see its body with the option off (with it on they never did). All read 100.0% / 100.0%, as in main's full build: UpdateBurningMan, UpdateChild, UpdateDrunkard, UpdateFireEater, UpdateHunterDog, UpdateJester, UpdateMother and TribesState::applyLadderDestructionToTribeUnits. Measured with real builds on main 0cea04dbf4 (bundled MSVC1400-SP1, function and data resolvers on locally, reccmp raw / normalised): 100.0 / 100.0 in a small build with the option off and in one with it on (519 files, 529 functions each: every /GL file of main, the two functions of this branch, their callers and callee closures). Co-Authored-By: Claude Fable 5.2 --- cmake/compiler-flags-gl.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/compiler-flags-gl.txt b/cmake/compiler-flags-gl.txt index 627129c454..4712b8db8c 100644 --- a/cmake/compiler-flags-gl.txt +++ b/cmake/compiler-flags-gl.txt @@ -325,7 +325,6 @@ src/OpenSHC/Map/Units/UnitsState/assignPeasantToBuilding.cpp src/OpenSHC/Map/Units/UnitsState/changeUnitType.cpp src/OpenSHC/Map/Units/UnitsState/clearSelectionCountsAndPlayerIDs.cpp src/OpenSHC/Map/Units/UnitsState/computeDistanceToNearestEnemyForLegacyMissions.cpp -src/OpenSHC/Map/Units/UnitsState/computeLadderClimbPath.cpp src/OpenSHC/Map/Units/UnitsState/countLivingNondyingUnitsForPlayer.cpp src/OpenSHC/Map/Units/UnitsState/countSelectedCatapultsAndTrebuchets.cpp src/OpenSHC/Map/Units/UnitsState/createTribeFromSelectedUnits.cpp