Hi All,
The patch does the following transformation :
(sub (or A, B) (and A, B)) --> (xor A, B)
Z3 Link : http://rise4fun.com/Z3/oeyxv
Please help in reviewing it.
Regards,
Sonam.
Differential D5720
Added a new transformation " (sub (or A, B) (and A, B)) --> (xor A, B) " sonamkumari on Oct 9 2014, 11:20 PM. Authored by
Details
Hi All, The patch does the following transformation : (sub (or A, B) (and A, B)) --> (xor A, B) Z3 Link : http://rise4fun.com/Z3/oeyxv Please help in reviewing it. Regards,
Diff Detail Event TimelineComment Actions Hi Sean, Thanks for reviewing the patch.Similar kind of pattern optimizations have been added in visitAdd(). Regards, Comment Actions You still have not answered to Sean's question, namely, which Comment Actions Hi Anton, Thanks for your comments. Kindly provide your feedback. Regards, Comment Actions The question still applies (and actually is very in-line with Hal's comments in D5719) - you need to provide some evidence that such pattern indeed happens in practice (why it's so hard to count how many times it happens in test-suite? after more than month?). And it's not some random stuff which you simple want to commit in due to some reason you do not want to share with us. Comment Actions
Just to be clear, I think these (three nodes -> one node) transformations, which don't rely on calls to ValueTracking, should all be added (because, in my experience working on a superoptimizer, they essentially all happen eventually and lacking them leads to surprising behavior in combination with other optimizations). However, that having been said, it is a perfectly reasonable question to ask what motivated this particular patch? How did you see this? The answer to this question might motivate other work, allow us to better understand the results of other optimizations, etc. and so I still believe that understanding the motivation is important. Thanks again,
Comment Actions Upthread Suyog mentions a "similar" transformation in visitAdd, which was |