[llvm-bugs] [Bug 33631] New: ThinLTO doesn't apply interprocedural GlobalDCE optimization

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 28 12:48:26 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33631

            Bug ID: 33631
           Summary: ThinLTO doesn't apply interprocedural GlobalDCE
                    optimization
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Interprocedural Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: charles.saternos at gmail.com
                CC: llvm-bugs at lists.llvm.org

// a.c
int jj = 10;

int x() {
    return jj;
}

int f(int x) {
    return x + 1;
}

// b.c

extern int f(int);

int main(void) {
  return 1;
}

///////////////////

# === THINLTO ===
$ ../build/bin/clang a.c b.c --for-linker=-mllvm --for-linker=-stats -flto=thin
\
    -fuse-ld=lld -o out &>&1 | grep globaldce

# nothing

# === LTO ===
$ ../build/bin/clang a.c b.c --for-linker=-mllvm --for-linker=-stats -flto \
    -fuse-ld=lld -o out &>&1 | grep globaldce
   2 globaldce      - Number of functions removed
   1 globaldce      - Number of global variables removed

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170628/9c47d23e/attachment.html>


More information about the llvm-bugs mailing list