MCPcopy Create free account
hub / github.com/AdaptiveCpp/AdaptiveCpp / functionDoesNotAccessMemory

Function functionDoesNotAccessMemory

src/compiler/stdpar/SyncElision.cpp:151–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151bool functionDoesNotAccessMemory(llvm::Function* F){
152 if(!F)
153 return true;
154 if(F->isIntrinsic()) {
155 if(llvmutils::starts_with(F->getName(), "llvm.lifetime")){
156 return true;
157 }
158 }
159 // We could improve this logic massively: E.g. a function which does not have ptr arguments,
160 // does not have gobal variable users, contains no inttoptr instructions, and only calls functions
161 // which satisfy these criteria could be assumed to not access memory.
162 return false;
163}
164
165// returns whether To is in the same BB as From, and succeeds it in the instruction list.
166bool isSucceedingInBB(llvm::Instruction* From, llvm::Instruction* To) {

Calls 1

starts_withFunction · 0.85

Tested by

no test coverage detected