This is an archive of the discontinued LLVM Phabricator instance.

[FuzzMutate] Fix getWeight of InstDeleterIRStrategy
ClosedPublic

Authored by liblor on Feb 6 2021, 9:03 AM.

Details

Summary

The comment states the following, for calculating the Line variable:

Draw a line starting from when we only have 1k left and increasing linearly to double the current weight.

However, the value was not calculated as described. Instead, it would result in a negative value, which resulted in the function always returning 0 afterwards.

// Invariant: CurrentSize <= MaxSize - 200
// Invariant: CurrentWeight >= 0
int Line = (-2 * CurrentWeight) * (MaxSize - CurrentSize + 1000);
// {Line <= 0}

This commit fixes the issue and linearly interpolates as described.

Diff Detail

Event Timeline

liblor created this revision.Feb 6 2021, 9:03 AM
liblor requested review of this revision.Feb 6 2021, 9:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 6 2021, 9:03 AM
bogner accepted this revision.Feb 17 2021, 3:50 PM
This revision is now accepted and ready to land.Feb 17 2021, 3:50 PM

@bogner I don't have commit access. Can you commit it?

@bogner I don't have commit access. Can you commit it?

Ping

@bogner Ping, could someone commit?

xgupta added subscribers: fhahn, xgupta.EditedMay 26 2021, 5:37 AM

CC @fhahn who has last committed to this file.

bogner added a comment.Jun 8 2021, 9:37 AM

Oh sorry, I missed the comments asking for someone to commit this. I'll commit it for you later today.

This revision was landed with ongoing or failed builds.Jun 8 2021, 11:17 AM
This revision was automatically updated to reflect the committed changes.