HomePhabricator

[InstCombine] reduce redundant code for shl-binop folds

Authored by spatel on Sep 28 2021, 1:59 PM.

Description

[InstCombine] reduce redundant code for shl-binop folds

This is NFCI (no-functional-change-intended), but there
are benign diffs possible with commutable ops as seen in
the test diffs.

The transforms were repeated for the commutative opcodes,
but that should not be necessary if we canonicalize the
patterns that we're matching. If both operands of the
binop match, that should get folded eventually.

The transform that starts with a mask op seems to
over-constrain the use checks, so that could be a
potential enhancement.

Details

Committed
spatelSep 28 2021, 2:06 PM
Parents
rG6c1a58fe51bc: [InstCombine] add multi-use tests for shl folds; NFC
Branches
Unknown
Tags
Unknown