Currently you have to pass -mllvm --enable-knowledge-retention for LLVM to fold
%cmp = icmp ne ptr %ptr, null
call void @llvm.assume(i1 %cmp)
into
call void @llvm.assume(i1 true) [ "nonnull"(ptr %ptr) ]
AFAICT the operand bundles seem to be strictly superior for optimization compared to an equivalent instruction based version. Is there a reason this fold isn't enabled by default/unconditionally?