[globalisel][tablegen] Skip src child predicates
authorDiana Picus <diana.picus@linaro.org>
Fri, 3 Nov 2017 10:30:19 +0000 (10:30 +0000)
committerDiana Picus <diana.picus@linaro.org>
Fri, 3 Nov 2017 10:30:19 +0000 (10:30 +0000)
commitd1b618177a7e0beb832a29cb4aa7b9663276696d
tree3b08e7d3551693434a5af7d8cecabbb41eb8e1d5
parentacf4bf21ab7aa9131bbd1d4a7331f8e0214974a8
[globalisel][tablegen] Skip src child predicates

The GlobalISel TableGen backend didn't check for predicates on the
source children. This caused it to generate code for ARM patterns such
as SMLABB or similar, but without properly checking for the sext_16_node
part of the operands. This in turn meant that we would select SMLABB
instead of MLA for simple sequences such as s32 + s32 * s32, which is
wrong (we want a MLA on the full operands, not just their bottom 16
bits).

This patch forces TableGen to skip patterns with predicates on the src
children, so it doesn't generate code for SMLABB and other similar ARM
instructions at all anymore. AArch64 and X86 are not affected.

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

llvm-svn: 317313
llvm/test/CodeGen/ARM/GlobalISel/arm-instruction-select-combos.mir
llvm/utils/TableGen/GlobalISelEmitter.cpp