[DAGCombiner] Fold step_vector with add/mul/shl
authorJun Ma <JunMa@linux.alibaba.com>
Thu, 8 Apr 2021 05:09:24 +0000 (13:09 +0800)
committerJun Ma <JunMa@linux.alibaba.com>
Thu, 15 Apr 2021 10:06:35 +0000 (18:06 +0800)
commit7e1422c1e43023e4cd5fbb3305f8dbf2d626e87e
tree95d38ffea6d16f6b366f097c47bb0bec50dd0ed8
parentea14df695ebde3f5bdd5ba7548d3d49e8f1c4411
[DAGCombiner] Fold step_vector with add/mul/shl

This patch implements some DAG combines for STEP_VECTOR:
add step_vector(C1), step_vector(C2) -> step_vector(C1+C2)
add (add X step_vector(C1)), step_vector(C2) -> add X step_vector(C1+C2)
mul step_vector(C1), C2 -> step_vector(C1*C2)
shl step_vector(C1), C2 -> step_vector(C1<<C2)

TestPlan: check-llvm

Differential Revision: https://reviews.llvm.org/D100088
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/sve-stepvector.ll