[MCA][RegisterFile] Fix register class check for move elimination (PR50265)
authorAndrea Di Biagio <andrea.dibiagio@sony.com>
Fri, 7 May 2021 19:20:03 +0000 (20:20 +0100)
committerAndrea Di Biagio <andrea.dibiagio@sony.com>
Fri, 7 May 2021 20:30:25 +0000 (21:30 +0100)
commit3822ac909ead8f41ebc81e382bb01908bf04f407
treec83232bdefe81738f5931c19da0f70f399155927
parentc4adc49a1c988e6ea8a340b6245525ef5599812c
[MCA][RegisterFile] Fix register class check for move elimination (PR50265)

The register file should always check if the destination register is from a
register class that allows move elimination.

Before this change, the check on the register class was only performed in a few
very specific cases. However, it should have always been performed.
This patch fixes the issue.

Note that none of the upstream scheduling models is currently affected by this
bug, so there is no test for it. The issue was found by Roman while working on
the znver3 model. I was able to reproduce the issue locally by tweaking the
btver2 model. I then verified that this patch fixes the issue.
llvm/lib/MCA/HardwareUnits/RegisterFile.cpp