AIUI AssumeSimplifyPass manifests equivalent information in the IR and drops redundant assumes. Perhaps it’s worth looking into running that pass by default? And we could extend it to heuristically drop assumes that may block optimizations, especially if this happens in the middle of the optimization pipeline where some passes have already had the chance to take advantage of the assumes.
For example, we currently don’t drop the assume in
declare void @llvm.assume(i1)
declare void @g(ptr)
define void @f(ptr nonnull %p) {
call void @llvm.assume(i1 true) [ "nonnull"(ptr %p) ]
call void @g(ptr %p)
ret void
}