[PATCH] D39871: [arm] Fix Unnecessary reloads from GOT.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 10 17:32:06 PST 2017


eugenis added a comment.

I've done some testing. All sanitizer tests pass on arm/android, both with and without -asan-with-ifunc (which is what I'm doing this for).

Code size of libclang_rt.asan-arm-android.so is down by 3% (!). It is just a regular library (i.e. no asan instrumentation in it), so I assume that all other code is similarly improved.

Unfortunately, even with this change MachineCSE is not good enough to enable -asan-with-ifunc (it brings it from 15% code bloat to "only" 5%). For example, the following code generates a GOT load in each bb:

  extern char x;
  void bar();
  void use(char *p);
  void foo(int n) {
    if (n > 10) {
      use(&x);
    } else {
      bar();
      use(&x);
    }
  }

Anyway, this change is a clear improvement.


https://reviews.llvm.org/D39871





More information about the llvm-commits mailing list