[PATCH] MIPS: Add comment to explain why PIC code gen is the default for MIPS

Petar Jovanovic petarj at mips.com
Mon Oct 6 12:15:06 PDT 2014

Comment at: lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp:103
@@ -95,1 +102,3 @@
+    // possible to make non-PIC the default here now, which would have the
+    // benefit of generating slightly faster code.
     RM = Reloc::PIC_;
As I mentioned in D5442, PIC code is generally more efficient in N64, so this part of the comment is not completely valid. In those cases, setting RM to Reloc::Static will actually have no effect, since PIC code will be generated.
It is true that the reasons for PIC in MIPS Linux are historical en générale, though in LLVM case this might have been caused by different defaults at the time.


More information about the llvm-commits mailing list