[llvm-commits] [llvm] r158433 - in /llvm/trunk/lib/Target/Mips: Mips.h MipsTargetMachine.cpp

Akira Hatanaka ahatanaka at mips.com
Wed Jun 13 18:19:36 PDT 2012


Author: ahatanak
Date: Wed Jun 13 20:19:35 2012
New Revision: 158433

URL: http://llvm.org/viewvc/llvm-project?rev=158433&view=rev
Log:
Add long branch expansion pass for MIPS.


Modified:
    llvm/trunk/lib/Target/Mips/Mips.h
    llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp

Modified: llvm/trunk/lib/Target/Mips/Mips.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/Mips.h?rev=158433&r1=158432&r2=158433&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/Mips.h (original)
+++ llvm/trunk/lib/Target/Mips/Mips.h Wed Jun 13 20:19:35 2012
@@ -24,6 +24,7 @@
 
   FunctionPass *createMipsISelDag(MipsTargetMachine &TM);
   FunctionPass *createMipsDelaySlotFillerPass(MipsTargetMachine &TM);
+  FunctionPass *createMipsLongBranchPass(MipsTargetMachine &TM);
   FunctionPass *createMipsJITCodeEmitterPass(MipsTargetMachine &TM,
                                              JITCodeEmitter &JCE);
 

Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp?rev=158433&r1=158432&r2=158433&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Wed Jun 13 20:19:35 2012
@@ -124,7 +124,13 @@
 // machine code is emitted. return true if -print-machineinstrs should
 // print out the code after the passes.
 bool MipsPassConfig::addPreEmitPass() {
-  PM->add(createMipsDelaySlotFillerPass(getMipsTargetMachine()));
+  MipsTargetMachine &TM = getMipsTargetMachine();
+  PM->add(createMipsDelaySlotFillerPass(TM));
+
+  // NOTE: long branch has not been implemented for mips16.
+  if (TM.getSubtarget<MipsSubtarget>().hasStandardEncoding())
+    PM->add(createMipsLongBranchPass(TM));
+
   return true;
 }
 





More information about the llvm-commits mailing list