HomePhabricator

[DAGCombiner] allow narrowing of add followed by truncate

Description

[DAGCombiner] allow narrowing of add followed by truncate

trunc (add X, C ) --> add (trunc X), C'

If we're throwing away the top bits of an 'add' instruction, do it in the narrow destination type.
This makes the truncate-able opcode list identical to the sibling transform done in IR (in instcombine).

This change used to show regressions for x86, but those are gone after D55494.
This gets us closer to deleting the x86 custom function (combineTruncatedArithmetic)
that does almost the same thing.

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

Details

Committed
spatelDec 22 2018, 9:10 AM
Differential Revision
D55866: [DAGCombiner] allow narrowing of add followed by truncate
Parents
rL350005: [x86] add load fold patterns for movddup with vzext_load
Branches
Unknown
Tags
Unknown