diff options
author | Matthias Braun <matze@braunis.de> | 2016-07-12 19:04:30 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2016-07-12 19:04:30 +0000 |
commit | 96ec47db745541855d8a5c359921f44ca86f3465 (patch) | |
tree | 99cf52558d4c236a72675e570c677327edc12e74 /llvm/lib/Target/X86/X86FixupBWInsts.cpp | |
parent | 657f871a4e7e58781fa36fe9371483283c11b100 (diff) | |
download | bcm5719-llvm-96ec47db745541855d8a5c359921f44ca86f3465.tar.gz bcm5719-llvm-96ec47db745541855d8a5c359921f44ca86f3465.zip |
X86FixupBWInsts: No need for forward liveness analysis.
With r274952 and r275201 in place there are no cases left where a
forward liveness analysis yields different results than a backward one.
So we can remove the forward stepping logic.
Differential Revision: http://reviews.llvm.org/D22083
llvm-svn: 275204
Diffstat (limited to 'llvm/lib/Target/X86/X86FixupBWInsts.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86FixupBWInsts.cpp | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/llvm/lib/Target/X86/X86FixupBWInsts.cpp b/llvm/lib/Target/X86/X86FixupBWInsts.cpp index 79215866699..90e758dc2e0 100644 --- a/llvm/lib/Target/X86/X86FixupBWInsts.cpp +++ b/llvm/lib/Target/X86/X86FixupBWInsts.cpp @@ -342,7 +342,6 @@ void FixupBWInstPass::processBasicBlock(MachineFunction &MF, // We run after PEI, so we need to AddPristinesAndCSRs. LiveRegs.addLiveOuts(MBB); - bool CandidateDidntGetTransformed = false; bool WasCandidate = false; for (auto I = MBB.rbegin(); I != MBB.rend(); ++I) { @@ -354,46 +353,12 @@ void FixupBWInstPass::processBasicBlock(MachineFunction &MF, // nullptr. We will revisit that in a bit. if (WasCandidate) { MIReplacements.push_back(std::make_pair(MI, NewMI)); - if (!NewMI) - CandidateDidntGetTransformed = true; } // We're done with this instruction, update liveness for the next one. LiveRegs.stepBackward(*MI); } - if (CandidateDidntGetTransformed) { - // If there was a candidate that didn't get transformed then let's try - // doing the register liveness going forward. Sometimes one direction - // is overly conservative compared to the other. - // FIXME - Register liveness should be investigated further. This really - // shouldn't be necessary. See PR28142. - LiveRegs.clear(); - 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) { - if (NextCandidateIter->second == nullptr) { - MachineInstr *NewMI = tryReplaceInstr(MI, MBB, WasCandidate); - NextCandidateIter->second = NewMI; - } - ++NextCandidateIter; - } - } - } - while (!MIReplacements.empty()) { MachineInstr *MI = MIReplacements.back().first; MachineInstr *NewMI = MIReplacements.back().second; |