[DAG] Add visitABD optimizations
This adds basic a visitABD to optimize ABDS and ABDU nodes, similar to the existing visitAVG method. The fold I was initially interested in was folding shuffles though the binop. This also: - Marks ABDS and ABDU as commutative binops (https://alive2.llvm.org/ce/z/oCDogb and https://alive2.llvm.org/ce/z/7zrs86). - Add reassociative folds. - Add constant folding using max(x,y)-min(x,y) - Canonicalizes constants to the RHS - Folds abds x, 0 -> abs(x) (https://alive2.llvm.org/ce/z/4ZEibv) - Folds abdu x, 0 -> x (https://alive2.llvm.org/ce/z/J_rKqx) - Folds abd x, undef -> 0 (https://alive2.llvm.org/ce/z/NV6Nsv and https://alive2.llvm.org/ce/z/vs92hu). Differential Revision: https://reviews.llvm.org/D143193
Loading
Please sign in to comment