hernanponcedeleon / Dat3M

A verification tool for many memory models
MIT License
75 stars 27 forks source link

Converting bit-operations to arithmetic #74

Open ThomasHaas opened 3 years ago

ThomasHaas commented 3 years ago

Context: Some benchmarks involve a few bit-operations, potentially introduced through the compiler or by manual optimization. This can include xors to negate booleans (i1 Variables in LLVM) or shifts to perform multiplication.

Problem: Mixing the theories of bit-vectors and integers may slow down the solver.

Solution: If possible, bit-operations should be converted to integer or boolean operations if possible.

Example: bresenham's algorithm uses multiplication by 2. The compiler tends to replace this by bit-shifts, causing mixing of theories.

hernanponcedeleon commented 11 months ago

Does this one make sense still?

ThomasHaas commented 11 months ago

Yes, if we want to keep supporting integer encoding.