[PATCH] D51089: [LLD] [COFF] [RFC] Add support for creating range extension thunks for ARM

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 27 00:26:23 PDT 2018


mstorsjo added inline comments.


================
Comment at: COFF/Writer.cpp:360
+  // the existing thunks?
+  for (Defined *Sym : TargetThunks) {
+    if (isInRange(Type, Sym->getRVA(), P))
----------------
ruiu wrote:
> I don't know if your above comment is true, but if the one this loop is looking for is likely at the end of the vector, I'd search in the reverse order. I.e.
> 
>   for (Defined *Sym : llvm::reverse(TargetThunks))
That's a nice idea. I'm changing code to keep the mapping of existing thunks stable across passes, so then the comment doesn't apply quite as much as before. I tested this and it didn't really save any measurable runtime, but it might be worthwhile anyway, as long as we iterate through the whole vector.


================
Comment at: COFF/Writer.cpp:362
+    if (isInRange(Type, Sym->getRVA(), P))
+      return std::pair<Defined *, bool>(Sym, false);
+  }
----------------
ruiu wrote:
> Can this just be `return {Sym, false}`?
Indeed, will simplify the syntax of these.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D51089





More information about the llvm-commits mailing list