OSDN Git Service

[ARM] Enable mixed types in ARM CGP
authorSam Parker <sam.parker@arm.com>
Fri, 9 Nov 2018 09:28:27 +0000 (09:28 +0000)
committerSam Parker <sam.parker@arm.com>
Fri, 9 Nov 2018 09:28:27 +0000 (09:28 +0000)
commit8e070ff5958e5179716a890d24076db62dfd6a1b
tree8db77f6ed6ef9e6f359cae8fa8d6b779b6ff330b
parent0a1353a3c8c9ffa4a6a8e4c818f2c9ec31551805
[ARM] Enable mixed types in ARM CGP

Previously, during the search, all values had to have the same
'TypeSize', which is equal to number of bits of the integer type of
the icmp operand. All values in the tree had to match this size;
meaning that, if we searched from i16, we wouldn't accept i8s. A
change in type size requires zext and truncs to perform the casts so,
to allow mixed narrow types, the handling of these instructions is
now slightly different:

- we allow casts if their result or operand is <= TypeSize.
- zexts are sinks if their result > TypeSize.
- truncs are still sinks if their operand == TypeSize.
- truncs are still sources if their result == TypeSize.

The transformation bails on finding an icmp that operates on data
smaller than the current TypeSize.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346480 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMCodeGenPrepare.cpp
test/CodeGen/ARM/CGP/arm-cgp-calls.ll
test/CodeGen/ARM/CGP/arm-cgp-casts.ll
test/CodeGen/ARM/CGP/arm-cgp-signed-icmps.ll