[SVE] Fix invalid assert in expand_DestructiveOp.
authorPaul Walker <paul.walker@arm.com>
Sat, 4 Jul 2020 09:17:53 +0000 (09:17 +0000)
committerPaul Walker <paul.walker@arm.com>
Sat, 4 Jul 2020 09:21:40 +0000 (09:21 +0000)
commit7356b4243ad9dc373c63bb4b7ac0ba4f877c47ee
tree1a1769ed682b968dc25611f646f79ff3d657e8fe
parent15a60fe09f4618a7fb451f37aebfd1a671f83713
[SVE] Fix invalid assert in expand_DestructiveOp.

AArch64ExpandPseudo::expand_DestructiveOp contains an assert to
ensure the destructive operand's register is unique.  However,
this is only required when psuedo expansion emits a movprfx.

A simple example when a movprfx is not required is
  Z0 = FADD_ZPZZ_UNDEF_S P0, Z0, Z0
which expands to an unprefixed FADD_ZPmZ_S instruction.

This patch moves the assert to the places where a movprfx is emitted.

Differential Revision: https://reviews.llvm.org/D83029
llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
llvm/test/CodeGen/AArch64/sve-pseudos-expand-undef.mir [new file with mode: 0644]