Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic analysis #1

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

cemcebeci
Copy link
Contributor

No description provided.

DeducedConstraints deduceConstraints(int argIndex);

private:
llvm::SmallVector<llvm::SmallVector<mlir::Value>> expandToDNF(mlir::Value constraint);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think that DNF will be something that will come up a lot, you can wrap the vectors into a class like and put this in a header of their own

class DisjunctiveNormalFormExpression {
public:
<getters>

private:
llvm::SmallVector<llvm::SmallVector<mlir::Value>> Content;
};

to be honest i would not be even opposed to have a operation called DNFExpression and have this analysis as a pass that mutates the ir and turns every precondition into a DNF

}


void helper(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename with a meaningful name, furthemore this function can be made static

*/
llvm::SmallVector<llvm::SmallVector<mlir::Value>> DynamicArgumentAnalysis::expandToDNF(mlir::Value constraint) {
llvm::SmallVector<llvm::SmallVector<mlir::Value>> conjunctions;
helper(conjunctions, {constraint}, precondition);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need the helper out of line here?

}

//TODO
const int64_t min_int = -800;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess you were looking for std::numeric_limits<int64_t>::min()

return KNOWN_VALUE;
}

mlir::Value DynamicArgumentAnalysis::compute(mlir::Value expression) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you provide a more informative name? compute is not very specific

@drblallo
Copy link
Contributor

the part of the code that emits the code that computes min and max is complex, can't it be somehow simplified by placing as much code as possible in the fuzzer standard library and calling it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants