This patch corresponds to the discussion we had in the following link about generation of psad in loop vectorizer
http://permalink.gmane.org/gmane.comp.compilers.llvm.devel/81724
Couple of structures were added to make it generic so that other patterns in the future can be easily integrated.
If this function applies only to ISDs, then it should not be here. This header only contains functions directly useful to IR-level passes. You can add this as a callback in the BasicTTI implementation, specialized by the targets, in order to share code.