[llvm] r272835 - [X86]: Fix for uninitialized access introduced in r272797.
Kevin B. Smith via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 15 13:52:20 PDT 2016
Author: kbsmith1
Date: Wed Jun 15 15:52:19 2016
New Revision: 272835
URL: http://llvm.org/viewvc/llvm-project?rev=272835&view=rev
Log:
[X86]: Fix for uninitialized access introduced in r272797.
Modified:
llvm/trunk/lib/Target/X86/X86FixupBWInsts.cpp
Modified: llvm/trunk/lib/Target/X86/X86FixupBWInsts.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FixupBWInsts.cpp?rev=272835&r1=272834&r2=272835&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FixupBWInsts.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FixupBWInsts.cpp Wed Jun 15 15:52:19 2016
@@ -372,12 +372,16 @@ void FixupBWInstPass::processBasicBlock(
LiveRegs.addLiveIns(MBB);
auto NextCandidateIter = MIReplacements.begin();
+ auto EndCandidateIter = MIReplacements.end();
for (auto I = MBB.begin(); I != MBB.end(); ++I) {
MachineInstr *MI = &*I;
SmallVector<std::pair<unsigned, const MachineOperand*>, 4> Clobbers;
LiveRegs.stepForward(*MI, Clobbers);
+ if (NextCandidateIter == EndCandidateIter)
+ break;
+
// Only check and create a new instruction if this instruction is
// known to be a candidate that didn't get transformed.
if (NextCandidateIter->first == MI) {
More information about the llvm-commits
mailing list