![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/include/llvm-10/llvm/Analysis/ |
Upload File : |
//===- ScopedNoAliasAA.h - Scoped No-Alias Alias Analysis -------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // /// \file /// This is the interface for a metadata-based scoped no-alias analysis. // //===----------------------------------------------------------------------===// #ifndef LLVM_ANALYSIS_SCOPEDNOALIASAA_H #define LLVM_ANALYSIS_SCOPEDNOALIASAA_H #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/IR/InstrTypes.h" #include "llvm/IR/PassManager.h" #include "llvm/Pass.h" #include <memory> namespace llvm { class Function; class MDNode; class MemoryLocation; /// A simple AA result which uses scoped-noalias metadata to answer queries. class ScopedNoAliasAAResult : public AAResultBase<ScopedNoAliasAAResult> { friend AAResultBase<ScopedNoAliasAAResult>; public: /// Handle invalidation events from the new pass manager. /// /// By definition, this result is stateless and so remains valid. bool invalidate(Function &, const PreservedAnalyses &, FunctionAnalysisManager::Invalidator &) { return false; } AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI); ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI); ModRefInfo getModRefInfo(const CallBase *Call1, const CallBase *Call2, AAQueryInfo &AAQI); private: bool mayAliasInScopes(const MDNode *Scopes, const MDNode *NoAlias) const; }; /// Analysis pass providing a never-invalidated alias analysis result. class ScopedNoAliasAA : public AnalysisInfoMixin<ScopedNoAliasAA> { friend AnalysisInfoMixin<ScopedNoAliasAA>; static AnalysisKey Key; public: using Result = ScopedNoAliasAAResult; ScopedNoAliasAAResult run(Function &F, FunctionAnalysisManager &AM); }; /// Legacy wrapper pass to provide the ScopedNoAliasAAResult object. class ScopedNoAliasAAWrapperPass : public ImmutablePass { std::unique_ptr<ScopedNoAliasAAResult> Result; public: static char ID; ScopedNoAliasAAWrapperPass(); ScopedNoAliasAAResult &getResult() { return *Result; } const ScopedNoAliasAAResult &getResult() const { return *Result; } bool doInitialization(Module &M) override; bool doFinalization(Module &M) override; void getAnalysisUsage(AnalysisUsage &AU) const override; }; //===--------------------------------------------------------------------===// // // createScopedNoAliasAAWrapperPass - This pass implements metadata-based // scoped noalias analysis. // ImmutablePass *createScopedNoAliasAAWrapperPass(); } // end namespace llvm #endif // LLVM_ANALYSIS_SCOPEDNOALIASAA_H