[llvm] r277448 - HexagonVectorPrint.cpp: Fix r277370. Don't use getInstrVecReg() in the expression of assert(). It has side effects.

NAKAMURA Takumi via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 04:59:17 PDT 2016


Author: chapuni
Date: Tue Aug  2 06:59:16 2016
New Revision: 277448

URL: http://llvm.org/viewvc/llvm-project?rev=277448&view=rev
Log:
HexagonVectorPrint.cpp: Fix r277370. Don't use getInstrVecReg() in the expression of assert(). It has side effects.

Modified:
    llvm/trunk/lib/Target/Hexagon/HexagonVectorPrint.cpp

Modified: llvm/trunk/lib/Target/Hexagon/HexagonVectorPrint.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonVectorPrint.cpp?rev=277448&r1=277447&r2=277448&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonVectorPrint.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonVectorPrint.cpp Tue Aug  2 06:59:16 2016
@@ -141,7 +141,8 @@ bool HexagonVectorPrint::runOnMachineFun
     MachineBasicBlock *MBB = I->getParent();
     DEBUG(dbgs() << "Evaluating V MI\n"; I->dump());
     unsigned Reg = 0;
-    assert(getInstrVecReg(*I, Reg) && "Need a vector reg");
+    if (!getInstrVecReg(*I, Reg))
+      assert(!"Need a vector reg");
     MachineBasicBlock::instr_iterator MII = I->getIterator();
     if (I->isInsideBundle()) {
       DEBUG(dbgs() << "add to end of bundle\n"; I->dump());




More information about the llvm-commits mailing list