This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] xtheadmac: fix commutativity issue for the in/out register
ClosedPublic

Authored by philipp.tomsich on Feb 17 2023, 10:08 AM.

Details

Summary

The instructions in the XTHeadMac extension (multiply accumulate
instructions) were marked as commutative but because the destination
register was also an input (accumulate) register and was connected to
the destination register with a register allocator constraint, all
three operands (instead of two) were incorrectly considered
commutative. To fix that an appropriate fixCommutedOpIndices call was
added for these instructions in findCommutedOpIndices

New test functions have been added to test the correct behaviour in
xtheadmac.ll.

Diff Detail