[GVNHoist] Replace getDefiningAccess with getClobberingMemoryAccess (#240217)
getDefiningAccess in safeToHoistLdSt returns the nearest stores if we
don't query AA result by using getClobberingMemoryAccess. This reduce
the opportunity for optimization as isLiveOnEntryDef returns false
without updating in safeToHoistLdSt.
In the example (See Closes item): after hoisting left.a and left.b,
getDefiningAccess returns `store q` before.
As a result, we replace getDefiningAccess with getClobberingMemoryAccess
and then we can safely remove ensureOptimizedUses now.
Assisted-by: Claude # Test
Closes: #221578