Fix isGuaranteedLoopInvariant() check for invariance. The checks for alloca and alloc-like instructions was not valid when the 'KillingDef' was outside of the loop, while the 'CurrentDef' was inside the loop. In that case, the 'KillingDef' only overwrites the definition from the last iteration of the loop, and not the ones of all iterations, therefor it does not make the 'CurrentDef' to be dead.
Fixing issue : https://github.com/llvm/llvm-project/issues/52774
please use the new pass manager syntax (-passes=dse)