[PATCH] [InstCombineAddSub] Added the transformation - "sub (or A B) (xor A B) -> (and A B)"

David Majnemer david.majnemer at gmail.com
Sat Oct 18 02:47:12 PDT 2014


InstCombine is not supposed to handle every possible just because it is theoretically possible case.  It's engineered to be a series of engineering tradeoffs.  I don't know what the history of the similar transform is in VisitAdd, it's possible that it wasn't added in a principled way.

If we were to arbitrarily add patterns, we would eventually make InstCombine cripplingly slow.

http://reviews.llvm.org/D5719






More information about the llvm-commits mailing list