[PATCH] D25374: [DAGCombiner] Update most ADD combines to support general vector combines

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 11 14:37:20 PDT 2016


RKSimon added a comment.

In https://reviews.llvm.org/D25374#567407, @mkuper wrote:

> LGTM
>
> Although I'm curious - do you see this in real code?
>  To the best of my understanding, the major goal of DAG-level constant folding is to get rid of constants that weren't visible on the IR level. This happens with scalars quite a lot (e.g. because of GEP lowering), but I'm not sure I understand where "new" vector constants come from.


Thanks Michael, the only pattern from visitADD I've seen in the wild  is "(a+b) -> (a|b)", but this will hopefully be the first stage in making most of the DAGCombiner combines properly support vector patterns when they do. Both visitSUB and visitAND/visitOR/visitXOR have a lot more cases that do occur but I wanted to start with a relatively easy one! These along with better vector support for computeKnownBits (et al.) should have a greater (accumulative) effect on vector IR.


Repository:
  rL LLVM

https://reviews.llvm.org/D25374





More information about the llvm-commits mailing list