| 149 | } |
| 150 | |
| 151 | bool 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. |
| 166 | bool isSucceedingInBB(llvm::Instruction* From, llvm::Instruction* To) { |
no test coverage detected