[Hexagon] Consider HVX reg aliases for .cur warning

This commit is contained in:
Brian Cain 2018-09-28 10:14:11 -05:00 committed by Krzysztof Parzyszek
parent 916b35e783
commit b17f036a99
2 changed files with 18 additions and 3 deletions

View File

@ -597,9 +597,15 @@ void HexagonMCChecker::checkRegisterCurDefs() {
for (auto const &I : HexagonMCInstrInfo::bundleInstructions(MCII, MCB)) {
if (HexagonMCInstrInfo::isCVINew(MCII, I) &&
HexagonMCInstrInfo::getDesc(MCII, I).mayLoad()) {
unsigned Register = I.getOperand(0).getReg();
if (!registerUsed(Register))
reportWarning("Register `" + Twine(RI.getName(Register)) +
const unsigned RegDef = I.getOperand(0).getReg();
bool HasRegDefUse = false;
for (MCRegAliasIterator Alias(RegDef, &RI, true); Alias.isValid();
++Alias)
HasRegDefUse = HasRegDefUse || registerUsed(*Alias);
if (!HasRegDefUse)
reportWarning("Register `" + Twine(RI.getName(RegDef)) +
"' used with `.cur' "
"but not used in the same packet");
}

View File

@ -0,0 +1,9 @@
# RUN: llvm-mc -arch=hexagon -mcpu=hexagonv60 -mhvx -filetype=obj %s 2>&1 | llvm-objdump --mattr=+hvx -d - | FileCheck %s
{ v2.cur = vmem(r11++m0)
v5:4.h = vmpa(v3:2.ub,v5:4.ub)
}
# CHECK-NOT: warning: register `{{.+}}' used with `.cur' but not used in the same packet
# CHECK: vmpa
# CHECK: vmem