[RegisterBankInfo] Relax the assert of having matching type sizes on default mappings
authorQuentin Colombet <qcolombet@apple.com>
Sat, 18 Nov 2017 04:28:58 +0000 (04:28 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Sat, 18 Nov 2017 04:28:58 +0000 (04:28 +0000)
commitfe538f71453dd7eb750c3861e47a4b9014e6382c
tree2a3ddf16d6d75a528d359804b637d18ed915cc69
parent91801f68aa27602c2cd5f5dacac7082ed5277677
[RegisterBankInfo] Relax the assert of having matching type sizes on default mappings

Instead of asserting that the type sizes are exactly equal, we check
that the new size is big enough to contain the original type.
We have to relax this constrain because, right now, we sometimes
specify that things that are smaller than a storage type are legal
instead of widening everything to the size of a storage type.
E.g., we say that G_AND s16 is legal and we map that on GPR32.

This is something we may revisit in the future (either by changing
the legalization process or keeping track separately of the storage
size and the size of the type), but let us reflect the reality of
the situation for now.

llvm-svn: 318587
llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp
llvm/test/CodeGen/AArch64/GlobalISel/arm64-regbankselect.mir