Index: llvm/include/llvm/Transforms/IPO/Attributor.h =================================================================== --- llvm/include/llvm/Transforms/IPO/Attributor.h +++ llvm/include/llvm/Transforms/IPO/Attributor.h @@ -1682,6 +1682,32 @@ static const char ID; }; +/// An abstract interface to determine reachability of point A to B. +struct AAReachability : public StateWrapper, + public IRPosition { + AAReachability(const IRPosition &IRP) : IRPosition(IRP) {} + + /// Returns true if instruction is assumed reachable. + bool isAssumedReachable(const IRPosition &From, const IRPosition &To) const { + return true; + } + + /// Returns true if instruction is known reachable. + bool isKnownReachable(const IRPosition &From, const IRPosition &To) const { + return true; + } + + /// Return an IR position, see struct IRPosition. + const IRPosition &getIRPosition() const override { return *this; } + + /// Create an abstract attribute view for the position \p IRP. + static AAReachability &createForPosition(const IRPosition &IRP, + Attributor &A); + + /// Unique ID (due to the unique address) + static const char ID; +}; + /// An abstract interface for all noalias attributes. struct AANoAlias : public IRAttribute