HomePhabricator

[llvm][CodeGen] DAG Combiner folds for vscale.

Authored by fpetrogalli on Feb 18 2020, 11:13 AM.

Description

[llvm][CodeGen] DAG Combiner folds for vscale.

Summary:
This patch simplifies the DAGs generated when using the intrinsic @llvm.vscale.* as follows:

  • Fold (add (vscale * C0), (vscale * C1)) to (vscale * (C0 + C1)).
  • Canonicalize (sub X, (vscale * C)) to (add X, (vscale * -C)).
  • Fold (mul (vscale * C0), C1) to (vscale * (C0 * C1)).
  • Fold (shl (vscale * C0), C1) to (vscale * (C0 << C1)).

The test sve-gep-ll have been updated to reflect the folding introduced by this patch.

Reviewers: efriedma, sdesmalen, andwar, rengolin

Reviewed By: sdesmalen

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74782

Details

Committed
fpetrogalliFeb 21 2020, 10:03 AM
Reviewer
sdesmalen
Differential Revision
D74782: [llvm][CodeGen] DAG Combiner folds for vscale.
Parents
rGb178555318cd: [InstCombine] Improve simplify demanded bits worklist management
Branches
Unknown
Tags
Unknown