Check both operands for use of the $zero register which cannot be used with
an compact branch instruction.
Details
- Reviewers
dsanders vkalintiris
Diff Detail
Event Timeline
lib/Target/Mips/MipsInstrInfo.cpp | ||
---|---|---|
437–442 | There are currently six iterations over the operand list. 5 are findRegisterUseOperandIdx() calls (two of which are inside readsRegister()), then one more to copy the operands. findRegisterUseOperandIdx() checks subregisters so we can cut it down to two with: int ZeroOperandPosition = -1; if (I->isBranch() && !I->isPseudo()) { // Check for reads of any portion of ZERO_64. ZeroOperandPosition = I->findRegisterUseOperandIdx(Mips::ZERO_64); BranchWithZeroOperand = ZeroOperandPosition != -1; } then add the necessary signed -> unsigned cast in the loop below. | |
483–484 | indentation | |
test/CodeGen/Mips/compactbranches/no-beqzc-bnezc.ll | ||
106–107 | Could you check for the correct branch instruction instead? It's easy to get false-passes with just CHECK-NOT. | |
121–122 | Could you check for the correct branch instruction instead? |
I think the 'auto' should be 'const auto &' if possible and 'auto &' otherwise.