[PATCH] D68375: [llvm-exegesis][NFC] Rename ExegesisTarget::decrementLoopCounterAndLoop()

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 3 00:55:41 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL373571: [llvm-exegesis][NFC] Rename ExegesisTarget::decrementLoopCounterAndLoop() (authored by courbet, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D68375?vs=222971&id=222973#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68375/new/

https://reviews.llvm.org/D68375

Files:
  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


Index: llvm/trunk/tools/llvm-exegesis/lib/X86/Target.cpp
===================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/X86/Target.cpp
+++ llvm/trunk/tools/llvm-exegesis/lib/X86/Target.cpp
@@ -448,7 +448,8 @@
   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 @@
   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);
 }
 
Index: llvm/trunk/tools/llvm-exegesis/lib/Target.h
===================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/Target.h
+++ llvm/trunk/tools/llvm-exegesis/lib/Target.h
@@ -95,7 +95,8 @@
   }
 
   // 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");
Index: llvm/trunk/tools/llvm-exegesis/lib/SnippetRepetitor.cpp
===================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/SnippetRepetitor.cpp
+++ llvm/trunk/tools/llvm-exegesis/lib/SnippetRepetitor.cpp
@@ -79,7 +79,8 @@
       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());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68375.222973.patch
Type: text/x-patch
Size: 2785 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191003/edc512dc/attachment.bin>


More information about the llvm-commits mailing list