Files
lifting-bits-remill/scripts
Peter Goodman 94e5a9afe1 A few days of changes. First, some fixes in the dead flag/register analysis. It was slightly buggy. The trick was to split the live/dead tracking into two related bitsets that are updated in the same way. The first bitset, the register kill mask is used to mask the union of incoming live registers. This bitset is initially all set, then we update with revives/kills. As a mask, this ensures that certain things are killed. Then there's the revive set, which is initially unset then updated with revives/kills. This is ORed in, in order to ensure that specific flags are revived. This is more like the gen and kill sets in a typical data flow analysis.
The next big change was the introduction of seemingly useless volatile variables into the State structure between aithmetic flag bytes and general purpose registers. I observed that a lot of times LLVM would merge adjacent kills of flags into either a memset intrinsic or into a wider store. This is basically write combining, and these extra volatile fields ensure that writes to adjacent flags are independent. Ancedotally, this also helps dead store elimination.

The next change was to the optimizer plugin. Originally this did two things: first, remove calls to __mcsema_defer_inlining, and mark the callers of this function as having to always be inlined. This was to help dead flag elimination as a form of dead store elimination, because removing a pure callinst is fairly trivial. The next thing the optimizer did was replace all __mcsema_undefined_X intrinsics with Undef values. This was generally good but it didn't always do what I wanted. The resulting undef stores would sometimes be eliminated, and other times be replaced with 0-value stores. The latter is suboptimal. The new addition goes through all functions and removes stores of undef values.
2016-02-10 14:16:36 -05:00
..
2016-02-08 14:54:13 -05:00
2016-01-28 11:48:22 -05:00