/// non-volatile loads from objects pointed to by its pointer-typed
/// arguments, with arbitrary offsets.
///
- /// This property corresponds to the IntrReadArgMem LLVM intrinsic flag.
+ /// This property corresponds to the combination of the IntrReadMem
+ /// and IntrArgMemOnly LLVM intrinsic flags.
FMRB_OnlyReadsArgumentPointees =
FMRL_ArgumentPointees | static_cast<int>(ModRefInfo::Ref),
/// The only memory references in this function (if it has any) are
+ /// non-volatile stores from objects pointed to by its pointer-typed
+ /// arguments, with arbitrary offsets.
+ ///
+ /// This property corresponds to the combination of the IntrWriteMem
+ /// and IntrArgMemOnly LLVM intrinsic flags.
+ FMRB_OnlyWritesArgumentPointees =
+ FMRL_ArgumentPointees | static_cast<int>(ModRefInfo::Mod),
+
+ /// The only memory references in this function (if it has any) are
/// non-volatile loads and stores from objects pointed to by its
/// pointer-typed arguments, with arbitrary offsets.
///
FMRL_ArgumentPointees | static_cast<int>(ModRefInfo::ModRef),
/// The only memory references in this function (if it has any) are
+ /// reads of memory that is otherwise inaccessible via LLVM IR.
+ ///
+ /// This property corresponds to the LLVM IR inaccessiblememonly attribute.
+ FMRB_OnlyReadsInaccessibleMem =
+ FMRL_InaccessibleMem | static_cast<int>(ModRefInfo::Ref),
+
+ /// The only memory references in this function (if it has any) are
+ /// writes to memory that is otherwise inaccessible via LLVM IR.
+ ///
+ /// This property corresponds to the LLVM IR inaccessiblememonly attribute.
+ FMRB_OnlyWritesInaccessibleMem =
+ FMRL_InaccessibleMem | static_cast<int>(ModRefInfo::Mod),
+
+ /// The only memory references in this function (if it has any) are
/// references of memory that is otherwise inaccessible via LLVM IR.
///
/// This property corresponds to the LLVM IR inaccessiblememonly attribute.
FMRB_OnlyAccessesInaccessibleMem =
FMRL_InaccessibleMem | static_cast<int>(ModRefInfo::ModRef),
+ /// The function may perform non-volatile loads from objects pointed
+ /// to by its pointer-typed arguments, with arbitrary offsets, and
+ /// it may also perform loads of memory that is otherwise
+ /// inaccessible via LLVM IR.
+ ///
+ /// This property corresponds to the LLVM IR
+ /// inaccessiblemem_or_argmemonly attribute.
+ FMRB_OnlyReadsInaccessibleOrArgMem = FMRL_InaccessibleMem |
+ FMRL_ArgumentPointees |
+ static_cast<int>(ModRefInfo::Ref),
+
+ /// The function may perform non-volatile stores to objects pointed
+ /// to by its pointer-typed arguments, with arbitrary offsets, and
+ /// it may also perform stores of memory that is otherwise
+ /// inaccessible via LLVM IR.
+ ///
+ /// This property corresponds to the LLVM IR
+ /// inaccessiblemem_or_argmemonly attribute.
+ FMRB_OnlyWritesInaccessibleOrArgMem = FMRL_InaccessibleMem |
+ FMRL_ArgumentPointees |
+ static_cast<int>(ModRefInfo::Mod),
+
/// The function may perform non-volatile loads and stores of objects
/// pointed to by its pointer-typed arguments, with arbitrary offsets, and
/// it may also perform loads and stores of memory that is otherwise
//
// This property corresponds to the LLVM IR 'writeonly' attribute.
// This property corresponds to the IntrWriteMem LLVM intrinsic flag.
- FMRB_DoesNotReadMemory = FMRL_Anywhere | static_cast<int>(ModRefInfo::Mod),
+ FMRB_OnlyWritesMemory = FMRL_Anywhere | static_cast<int>(ModRefInfo::Mod),
/// This indicates that the function could not be classified into one of the
/// behaviors above.
llvm_unreachable("Unknown mod ref behaviour cannot be represented.");
case FMRB_DoesNotAccessMemory:
return true;
- case FMRB_DoesNotReadMemory:
+ case FMRB_OnlyWritesMemory:
+ case FMRB_OnlyWritesInaccessibleMem:
+ case FMRB_OnlyWritesInaccessibleOrArgMem:
case FMRB_OnlyAccessesInaccessibleMem:
case FMRB_OnlyAccessesInaccessibleOrArgMem:
return false;
case FMRB_OnlyReadsMemory:
+ case FMRB_OnlyReadsInaccessibleMem:
+ case FMRB_OnlyReadsInaccessibleOrArgMem:
GlobalReads.emplace_back(Stmt, CI);
return true;
case FMRB_OnlyReadsArgumentPointees:
ReadOnly = true;
LLVM_FALLTHROUGH;
+ case FMRB_OnlyWritesArgumentPointees:
case FMRB_OnlyAccessesArgumentPointees: {
auto AccType = ReadOnly ? MemoryAccess::READ : MemoryAccess::MAY_WRITE;
Loop *L = LI.getLoopFor(Inst->getParent());
return false;
case FMRB_DoesNotAccessMemory:
case FMRB_OnlyReadsMemory:
+ case FMRB_OnlyReadsInaccessibleMem:
+ case FMRB_OnlyReadsInaccessibleOrArgMem:
// Implicitly disable delinearization since we have an unknown
// accesses with an unknown access function.
Context.HasUnknownAccess = true;
return true;
case FMRB_OnlyReadsArgumentPointees:
case FMRB_OnlyAccessesArgumentPointees:
+ case FMRB_OnlyWritesArgumentPointees:
for (const auto &Arg : CI.arg_operands()) {
if (!Arg->getType()->isPointerTy())
continue;
// pointer into the alias set.
Context.AST.addUnknown(&CI);
return true;
- case FMRB_DoesNotReadMemory:
+ case FMRB_OnlyWritesMemory:
+ case FMRB_OnlyWritesInaccessibleMem:
+ case FMRB_OnlyWritesInaccessibleOrArgMem:
case FMRB_OnlyAccessesInaccessibleMem:
case FMRB_OnlyAccessesInaccessibleOrArgMem:
return false;