MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / parse_fmath

Function parse_fmath

llvm_util/utils.cpp:73–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71namespace llvm_util {
72
73FastMathFlags 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
94BasicBlock& getBB(const llvm::BasicBlock *bb) {
95 return current_fn->getBB(value_name(*bb));

Callers 8

known_callFunction · 0.85
visitUnaryOperatorMethod · 0.85
visitBinaryOperatorMethod · 0.85
visitCastInstMethod · 0.85
visitFCmpInstMethod · 0.85
visitSelectInstMethod · 0.85
visitPHINodeMethod · 0.85
visitIntrinsicInstMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected