[PATCH] D23547: [mips] Enforce compact branch restrictions

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 08:19:59 PDT 2016


dsanders accepted this revision.
dsanders added a comment.
This revision is now accepted and ready to land.

LGTM with a couple nits


================
Comment at: lib/Target/Mips/MipsInstrInfo.cpp:438
@@ +437,3 @@
+  if (I->isBranch() && !I->isPseudo()) {
+    auto TRI = I->getParent()->getParent()->getSubtarget().getRegisterInfo();
+    ZeroOperandPosition = I->findRegisterUseOperandIdx(Mips::ZERO, false, TRI);
----------------
I think the 'auto' should be 'const auto &' if possible and 'auto &' otherwise.

================
Comment at: lib/Target/Mips/MipsInstrInfo.cpp:439
@@ +438,3 @@
+    auto TRI = I->getParent()->getParent()->getSubtarget().getRegisterInfo();
+    ZeroOperandPosition = I->findRegisterUseOperandIdx(Mips::ZERO, false, TRI);
+    BranchWithZeroOperand = ZeroOperandPosition != -1;
----------------
I think we should include a comment that this will also find ZERO_64


https://reviews.llvm.org/D23547





More information about the llvm-commits mailing list