summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2017-10-13 21:16:13 +0000
committerQuentin Colombet <qcolombet@apple.com>2017-10-13 21:16:13 +0000
commitb1a3bd1529f6ca44c98dfde052953b906e6c58e1 (patch)
tree31315a640882912a2394ce08fb92daf9654d5170 /llvm/lib/CodeGen
parent86220488b420cbe2e1a34b035714c950e7d5a0bc (diff)
downloadbcm5719-llvm-b1a3bd1529f6ca44c98dfde052953b906e6c58e1.tar.gz
bcm5719-llvm-b1a3bd1529f6ca44c98dfde052953b906e6c58e1.zip
[LegalizerInfo] Don't evaluate end boundary every time through the loop
Match the LLVM coding standard for loop conditions. NFC. llvm-svn: 315757
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
index 4fc4fa7d3eb..e7a46eadb44 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
@@ -58,7 +58,7 @@ LegalizerInfo::LegalizerInfo() {
void LegalizerInfo::computeTables() {
for (unsigned Opcode = 0; Opcode <= LastOp - FirstOp; ++Opcode) {
- for (unsigned Idx = 0; Idx != Actions[Opcode].size(); ++Idx) {
+ for (unsigned Idx = 0, End = Actions[Opcode].size(); Idx != End; ++Idx) {
for (auto &Action : Actions[Opcode][Idx]) {
LLT Ty = Action.first;
if (!Ty.isVector())
@@ -145,8 +145,9 @@ std::tuple<LegalizerInfo::LegalizeAction, unsigned, LLT>
LegalizerInfo::getAction(const MachineInstr &MI,
const MachineRegisterInfo &MRI) const {
SmallBitVector SeenTypes(8);
- const MCOperandInfo *OpInfo = MI.getDesc().OpInfo;
- for (unsigned i = 0; i < MI.getDesc().getNumOperands(); ++i) {
+ const MCInstrDesc &MCID = MI.getDesc();
+ const MCOperandInfo *OpInfo = MCID.OpInfo;
+ for (unsigned i = 0, e = MCID.getNumOperands(); i != e; ++i) {
if (!OpInfo[i].isGenericType())
continue;
OpenPOWER on IntegriCloud