This property corresponds directly to the inaccessiblememonly function attribute.
I intend to use this attribute with the experimental constrained FP intrinsics that I will be adding soon, but it seemed best to have these changes reviewed separately.
I considered adding this attribute to the @llvm.assume() intrinsic as Hal suggested in the comments on D26382, but that would have resulted in changes to aliasing behavior which is specifically tested for in test/Analysis/BasicAA/assume.ll and I am not familiar enough with that intrinsic to be comfortable judging whether or not that is acceptable. Consequently, I have no direct test for this change set. I am, of course, open to guidance.
A notable piece of code that I did not change is the InstAnalyzer::AnalyzeNode() function in utils/TableGen/CodeGenDAGPatterns.cpp. That function contains the following code:
if (const CodeGenIntrinsic *IntInfo = N->getIntrinsicInfo(CDP)) { // If this is an intrinsic, analyze it. if (IntInfo->ModRef & CodeGenIntrinsic::MR_Ref) mayLoad = true;// These may load memory. if (IntInfo->ModRef & CodeGenIntrinsic::MR_Mod) mayStore = true;// Intrinsics that can write to memory are 'mayStore'. if (IntInfo->ModRef >= CodeGenIntrinsic::ReadWriteMem) // ReadWriteMem intrinsics can have other strange effects. hasSideEffects = true; }
This code will not set the 'hasSideEffects' flag for intrinsics that use the IntrInaccessibleMemOnly property, but it currently does not set that flag for intrinsics that use the IntrArgMemOnly property. This seems wrong to me in both cases, but I decided to defer to the existing logic over my own judgment pending review.