[PATCH] D96207: [FuzzMutate] Fix getWeight of InstDeleterIRStrategy
Justin Bogner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 8 11:17:05 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7e976cd45685: [FuzzMutate] Fix getWeight of InstDeleterIRStrategy (authored by bogner).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96207/new/
https://reviews.llvm.org/D96207
Files:
llvm/lib/FuzzMutate/IRMutator.cpp
Index: llvm/lib/FuzzMutate/IRMutator.cpp
===================================================================
--- llvm/lib/FuzzMutate/IRMutator.cpp
+++ llvm/lib/FuzzMutate/IRMutator.cpp
@@ -143,7 +143,10 @@
return CurrentWeight ? CurrentWeight * 100 : 1;
// Draw a line starting from when we only have 1k left and increasing linearly
// to double the current weight.
- int Line = (-2 * CurrentWeight) * (MaxSize - CurrentSize + 1000);
+ int64_t Line = (-2 * static_cast<int64_t>(CurrentWeight)) *
+ (static_cast<int64_t>(MaxSize) -
+ static_cast<int64_t>(CurrentSize) - 1000) /
+ 1000;
// Clamp negative weights to zero.
if (Line < 0)
return 0;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96207.350669.patch
Type: text/x-patch
Size: 717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210608/e9af25f8/attachment.bin>
More information about the llvm-commits
mailing list