[llvm] r373571 - [llvm-exegesis][NFC] Rename ExegesisTarget::decrementLoopCounterAndLoop()
Clement Courbet via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 3 00:56:57 PDT 2019
Author: courbet
Date: Thu Oct 3 00:56:56 2019
New Revision: 373571
URL: http://llvm.org/viewvc/llvm-project?rev=373571&view=rev
Log:
[llvm-exegesis][NFC] Rename ExegesisTarget::decrementLoopCounterAndLoop()
Summary: To decrementLoopCounterAndJump, and explicitely take the jump target.
Reviewers: gchatelet
Subscribers: tschuett, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68375
Modified:
llvm/trunk/tools/llvm-exegesis/lib/SnippetRepetitor.cpp
llvm/trunk/tools/llvm-exegesis/lib/Target.h
llvm/trunk/tools/llvm-exegesis/lib/X86/Target.cpp
Modified: llvm/trunk/tools/llvm-exegesis/lib/SnippetRepetitor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-exegesis/lib/SnippetRepetitor.cpp?rev=373571&r1=373570&r2=373571&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/SnippetRepetitor.cpp (original)
+++ llvm/trunk/tools/llvm-exegesis/lib/SnippetRepetitor.cpp Thu Oct 3 00:56:56 2019
@@ -79,7 +79,8 @@ public:
for (const auto &LiveIn : Entry.MBB->liveins())
Loop.MBB->addLiveIn(LiveIn);
Loop.addInstructions(Instructions);
- ET.decrementLoopCounterAndLoop(*Loop.MBB, State.getInstrInfo());
+ ET.decrementLoopCounterAndJump(*Loop.MBB, *Loop.MBB,
+ State.getInstrInfo());
// Set up the exit basic block.
Loop.MBB->addSuccessor(Exit.MBB, llvm::BranchProbability::getZero());
Modified: llvm/trunk/tools/llvm-exegesis/lib/Target.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-exegesis/lib/Target.h?rev=373571&r1=373570&r2=373571&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/Target.h (original)
+++ llvm/trunk/tools/llvm-exegesis/lib/Target.h Thu Oct 3 00:56:56 2019
@@ -95,7 +95,8 @@ public:
}
// Adds the code to decrement the loop counter and
- virtual void decrementLoopCounterAndLoop(MachineBasicBlock &MBB,
+ virtual void decrementLoopCounterAndJump(MachineBasicBlock &MBB,
+ MachineBasicBlock &TargetMBB,
const llvm::MCInstrInfo &MII) const {
llvm_unreachable("decrementLoopCounterAndBranch() requires "
"getLoopCounterRegister() > 0");
Modified: llvm/trunk/tools/llvm-exegesis/lib/X86/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-exegesis/lib/X86/Target.cpp?rev=373571&r1=373570&r2=373571&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/X86/Target.cpp (original)
+++ llvm/trunk/tools/llvm-exegesis/lib/X86/Target.cpp Thu Oct 3 00:56:56 2019
@@ -448,7 +448,8 @@ private:
void fillMemoryOperands(InstructionTemplate &IT, unsigned Reg,
unsigned Offset) const override;
- void decrementLoopCounterAndLoop(MachineBasicBlock &MBB,
+ void decrementLoopCounterAndJump(MachineBasicBlock &MBB,
+ MachineBasicBlock &TargetMBB,
const llvm::MCInstrInfo &MII) const override;
std::vector<llvm::MCInst> setRegTo(const llvm::MCSubtargetInfo &STI,
@@ -558,14 +559,15 @@ void ExegesisX86Target::fillMemoryOperan
SetOp(MemOpIdx + 4, MCOperand::createReg(0)); // Segment
}
-void ExegesisX86Target::decrementLoopCounterAndLoop(
- MachineBasicBlock &MBB, const llvm::MCInstrInfo &MII) const {
+void ExegesisX86Target::decrementLoopCounterAndJump(
+ MachineBasicBlock &MBB, MachineBasicBlock &TargetMBB,
+ const llvm::MCInstrInfo &MII) const {
BuildMI(&MBB, DebugLoc(), MII.get(X86::ADD64ri8))
.addDef(kLoopCounterReg)
.addUse(kLoopCounterReg)
.addImm(-1);
BuildMI(&MBB, DebugLoc(), MII.get(X86::JCC_1))
- .addMBB(&MBB)
+ .addMBB(&TargetMBB)
.addImm(X86::COND_NE);
}
More information about the llvm-commits
mailing list