This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Fix invalid assert in expand_DestructiveOp.
ClosedPublic

Authored by paulwalker-arm on Jul 2 2020, 3:14 AM.

Details

Summary

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.

Diff Detail

Event Timeline

paulwalker-arm created this revision.Jul 2 2020, 3:14 AM
Herald added a project: Restricted Project. · View Herald Transcript
sdesmalen added inline comments.Jul 2 2020, 3:49 AM
llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
481

Why are you wrapping this in #ifndef NDEBUG ?

david-arm accepted this revision.Jul 2 2020, 4:13 AM
This revision is now accepted and ready to land.Jul 2 2020, 4:13 AM
paulwalker-arm marked an inline comment as done.Jul 2 2020, 4:19 AM
paulwalker-arm added inline comments.
llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
481

The definition of DOPRegIsUnique is protected by NDEBUG.

sdesmalen accepted this revision.Jul 2 2020, 1:47 PM

LGTM

llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
481

Okay that makes sense, thanks.

This revision was automatically updated to reflect the committed changes.