I am working to expand the coverage of the WriteOnly attribute when applied to functions:
This patch enables earlyCSE to handle calls to WriteOnly functions and updates lastStore and CurrentGeneration variables appropriately. canHandle will return true for WriteOnly function calls whether we have MSSA or not, but for non-MSSA they will never be the same generation (isSameMemGeneration()) and will not be CSE'd.
Add write_only_func attribute to Clang: https://reviews.llvm.org/D46313
Mark libm functions write_only_func when we care about errno: https://reviews.llvm.org/D48386
Infer WriteOnly attribute for functions: https://reviews.llvm.org/D48387
This patch allows EarlyCSE to handle WriteOnly function calls when using MSSA. Without MSSA the WriteOnly call instructions will be tracked, but never qualify to be eliminated.
Any feedback would be appreciated!
Indentation is off (tabs?).