Index: lib/Target/Hexagon/HexagonCommonGEP.cpp =================================================================== --- lib/Target/Hexagon/HexagonCommonGEP.cpp +++ lib/Target/Hexagon/HexagonCommonGEP.cpp @@ -212,7 +212,6 @@ if (Comma) OS << ','; OS << "used"; - Comma = true; } OS << "} "; if (GN.Flags & GepNode::Root) Index: lib/Target/Hexagon/HexagonFixupHwLoops.cpp =================================================================== --- lib/Target/Hexagon/HexagonFixupHwLoops.cpp +++ lib/Target/Hexagon/HexagonFixupHwLoops.cpp @@ -130,7 +130,6 @@ // Second pass - check each loop instruction to see if it needs to be // converted. - InstOffset = 0; bool Changed = false; for (MachineBasicBlock &MBB : MF) { InstOffset = BlockToInstOffset[&MBB]; Index: lib/Target/Hexagon/HexagonOptAddrMode.cpp =================================================================== --- lib/Target/Hexagon/HexagonOptAddrMode.cpp +++ lib/Target/Hexagon/HexagonOptAddrMode.cpp @@ -396,8 +396,8 @@ bool HexagonOptAddrMode::changeStore(MachineInstr *OldMI, MachineOperand ImmOp, unsigned ImmOpNum) { bool Changed = false; - unsigned OpStart; unsigned OpEnd = OldMI->getNumOperands(); + unsigned OpStart = OpEnd; MachineBasicBlock *BB = OldMI->getParent(); auto UsePos = MachineBasicBlock::iterator(OldMI); MachineBasicBlock::instr_iterator InsertPt = UsePos.getInstrIterator(); @@ -438,9 +438,11 @@ DEBUG(dbgs() << "[Changing]: " << *OldMI << "\n"); DEBUG(dbgs() << "[TO]: " << MIB << "\n"); } - if (Changed) + if (Changed) { + assert(OpStart < OpEnd && "unknown number of operands, cannot change instruction store"); for (unsigned i = OpStart; i < OpEnd; ++i) MIB.addOperand(OldMI->getOperand(i)); + } return Changed; } Index: lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp =================================================================== --- lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp +++ lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp @@ -79,7 +79,6 @@ } if (HexagonMCInstrInfo::isOuterLoop(*MI)) { OS << Separator; - Separator = " "; MCInst ME; ME.setOpcode(Hexagon::ENDLOOP1); printInstruction(&ME, OS); Index: lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp =================================================================== --- lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp +++ lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp @@ -180,7 +180,6 @@ if (MCS.size() == 1) { // case of one duplex // copy the created duplex in the shuffler to the bundle MCS.copyTo(MCB); - doneShuffling = true; return HexagonShuffler::SHUFFLE_SUCCESS; } // try shuffle with this duplex