[PATCH] D18298: ThinLTO: do not promote GlobalVariable that have a specific section.

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 02:31:37 PDT 2016


joker.eph added a comment.

I'm hitting a wall: even with adding the "hasSection" flag to the summary: no renaming a function breaks the model.

  Module A {
    define internal foo() { ... };
    define bar() { foobar() };
  }
  
  Module B {
    define foo() { ... };
    define foobar() { foo() };
  }

If we leave `internal foo()` internal in module A and we don't rename it, we have a problem when we want to import `foobar()` because of the collision on the call to `foo()` in module B.
There is nothing in the index that can help to address this situation. We reach a point were the only conservative strategy I can imagine is to detect the collision "late" (i.e. during the FunctionImporter, in the "backend" job) and do not perform the import.
This is annoying because it prevents future optimizations (like "moving" a global for instance).


http://reviews.llvm.org/D18298





More information about the llvm-commits mailing list