CodeGen: Avoid dereferencing end() in OptimizePHIs::OptimizeBB
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 17 Aug 2016 00:43:59 +0000 (00:43 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 17 Aug 2016 00:43:59 +0000 (00:43 +0000)
llvm-svn: 278879

llvm/lib/CodeGen/OptimizePHIs.cpp

index 0177e41..2a8531f 100644 (file)
@@ -184,7 +184,7 @@ bool OptimizePHIs::OptimizeBB(MachineBasicBlock &MBB) {
       for (InstrSetIterator PI = PHIsInCycle.begin(), PE = PHIsInCycle.end();
            PI != PE; ++PI) {
         MachineInstr *PhiMI = *PI;
-        if (&*MII == PhiMI)
+        if (MII == PhiMI)
           ++MII;
         PhiMI->eraseFromParent();
       }