git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279588
91177308-0d34-0410-b5e6-
96231b3b80d8
__attribute__((target("popcnt")))
static void AddValueForCmp(void *PCptr, uint64_t Arg1, uint64_t Arg2) {
+ if (Arg1 == Arg2)
+ return;
uintptr_t PC = reinterpret_cast<uintptr_t>(PCptr);
- VP.AddValue((PC & 4095) | (__builtin_popcountl(Arg1 ^ Arg2) << 12));
+ uint64_t ArgDistance = __builtin_popcountl(Arg1 ^ Arg2) - 1; // [0,63]
+ uintptr_t Idx = (PC & 4095) | (ArgDistance << 12);
+ VP.AddValue(Idx);
}
} // namespace fuzzer