[PATCH] D95288: [ValueTracking] Don't assume readonly function will return
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 23 11:45:05 PST 2021
nikic added inline comments.
================
Comment at: lib/Analysis/ValueTracking.cpp:5059
- // is guaranteed to return.
- return CB->onlyReadsMemory() || CB->onlyAccessesArgMemory();
}
----------------
fhahn wrote:
> I guess we could incorporate the `argmemonly` reasoning in 'FunctionAttrs`, using something like `argmemonly + nosync => willreturn`, assuming that IO can only happen through inaccessible memory? Just `argmemonly` would not be enough I think, because we still need to rule out volatile accesses/synchronization via. the arguments.
Yeah, I agree that mustprogress, argmemonly and nosync should imply willreturn. However, FuncAttrs currently infers neither nosync nor argmemonly, so it would need those first. I think that the argmemonly check here was there to cover some common intrinsics like `llvm.memcpy`, but those are explicitly willreturn now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95288/new/
https://reviews.llvm.org/D95288
More information about the llvm-commits
mailing list