Presumably patterns of the following kind could be optimized:
%0 = load i8, ptr %c, align 1 store i8 %0, ptr %a, align 1 %1 = load i8, ptr %c, align 1 store i8 %1, ptr %b, align 1
InstCombine is responsible for these optimization. Only this pass (InstCombinerImpl::visitLoadInst) uses llvm::FindAvailableLoadedValue to find previous available loads.
So we can add simple helper to get rid of the redundant code.