| 71 | namespace llvm_util { |
| 72 | |
| 73 | FastMathFlags parse_fmath(llvm::Instruction &i) { |
| 74 | FastMathFlags fmath; |
| 75 | if (auto op = dyn_cast<llvm::FPMathOperator>(&i)) { |
| 76 | if (op->hasNoNaNs()) |
| 77 | fmath.flags |= FastMathFlags::NNaN; |
| 78 | if (op->hasNoInfs()) |
| 79 | fmath.flags |= FastMathFlags::NInf; |
| 80 | if (op->hasNoSignedZeros()) |
| 81 | fmath.flags |= FastMathFlags::NSZ; |
| 82 | if (op->hasAllowReciprocal()) |
| 83 | fmath.flags |= FastMathFlags::ARCP; |
| 84 | if (op->hasAllowContract()) |
| 85 | fmath.flags |= FastMathFlags::Contract; |
| 86 | if (op->hasAllowReassoc()) |
| 87 | fmath.flags |= FastMathFlags::Reassoc; |
| 88 | if (op->hasApproxFunc()) |
| 89 | fmath.flags |= FastMathFlags::AFN; |
| 90 | } |
| 91 | return fmath; |
| 92 | } |
| 93 | |
| 94 | BasicBlock& getBB(const llvm::BasicBlock *bb) { |
| 95 | return current_fn->getBB(value_name(*bb)); |
no outgoing calls
no test coverage detected