[PATCH] Modify MIPS long branch for NaCl

Sasa Stankovic Sasa.Stankovic at imgtec.com
Wed May 28 11:29:06 PDT 2014


> BTW, if you're hitting this when targeting NaCl at the moment, you should probably turn off PIC code generation, since you don't need PIC for NaCl nexes.

Should this be done in LLVM, or in pnacl/driver scripts?

================
Comment at: lib/Target/Mips/MipsLongBranch.cpp:474
@@ +473,3 @@
+        // don't know the exact amount of code that "sandboxing" will add, we
+        // conservatively estimate that code will not grow more than 100%.
+        Offset *= 2;
----------------
Mark Seaborn wrote:
> Could the code grow by more than a factor of 2?  Some explanation of the max expansion factor here would be good.
> 
> e.g. "lw $sp, ($reg)" requires 2 sandboxing instructions to be added (before and after).
We measured code size on CSiBE, for pic relocation model (which on MIPS produces larger code than static), and sandboxing increased the size in the range 28% - 48%. I think it is very unlikely that the code will grow more than 100%.

http://reviews.llvm.org/D3928






More information about the llvm-commits mailing list