[SVE] Fix crashes with inline assembly
authorDavid Sherwood <david.sherwood@arm.com>
Tue, 1 Dec 2020 13:15:57 +0000 (13:15 +0000)
committerDavid Sherwood <david.sherwood@arm.com>
Tue, 8 Dec 2020 13:48:43 +0000 (13:48 +0000)
commit59f17b57d9c9abf86d8dcc05c49d3bbd807e29c7
tree24c1f8b1f6ae8bb7f01fb755523c104a88193fd9
parentbb7d43e7d5f683fc3e7109072610dc8d176a3bf8
[SVE] Fix crashes with inline assembly

All the crashes found compiling inline assembly are fixed in this
patch by changing AArch64TargetLowering::getRegForInlineAsmConstraint
to be more resilient to mismatched value and register types. For
example, it makes no sense to request a predicate register for
a nxv2i64 type and so on.

Tests have been added here:

  test/CodeGen/AArch64/inline-asm-constraints-bad-sve.ll

Differential Revision: https://reviews.llvm.org/D92554
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/inline-asm-constraints-bad-sve.ll [new file with mode: 0644]