HomePhabricator

[DAGCombiner] narrow truncated binops

Description

[DAGCombiner] narrow truncated binops

The motivating case for this is shown in:
https://bugs.llvm.org/show_bug.cgi?id=32023
and the corresponding rot16.ll regression tests.

Because x86 scalar shift amounts are i8 values, we can end up with trunc-binop-trunc
sequences that don't get folded in IR.

As the TODO comments suggest, there will be regressions if we extend this (for x86,
we mostly seem to be missing LEA opportunities, but there are likely vector folds
missing too). I think those should be considered existing bugs because this is the
same transform that we do as an IR canonicalization in instcombine. We just need
more tests to make those visible independent of this patch.

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

Details

Committed
spatelNov 29 2018, 12:58 PM
Differential Revision
D54640: [DAGCombiner] narrow truncated binops
Parents
rL347916: [obj2yaml] [COFF] Write RVA instead of VA for sections, fix roundtripping…
Branches
Unknown
Tags
Unknown