[llvm-dev] LLVM X86 backend combineIncDecVector's transform
Amaury Séchet via llvm-dev
llvm-dev at lists.llvm.org
Mon Aug 26 10:48:13 PDT 2019
As you knwo already, I'm trying to change DAGCombiner so that it process
the nodes in topological order. Doing so is not difficult per se, but this
creates various improvements and regression to the existing test suite. I'd
like to work through as many of the regressions as possible ahead of time.
One source of such regressions is combineIncDecVector in the X86 backend.
It changes (add X, 1) into (sub X, -1) in order to be able to use the
This is all well and good, but numerous paterns are matching an add rather
than a sub, and in fact, DAGCombiner does the inverse transform by itself
as it consider the add form to be canonical. An example of such pattern is
the X86ISD::AVG node, but there are more.
It seems to me like this transformation is useful, but doesn't happen at
the right place in the pipeline. Doing so later on, for instance at the DAG
to DAG level would likely give DAGCombiner more opportunities to do its
job, and also ensure that all instances of the pattern are detected.
It would be great if someone familiar with the X86 backend could look into
Thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev