[llvm-bugs] [Bug 49776] New: missed optimization for dead code elimination at -O3 (vs. -O2)

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 30 13:07:50 PDT 2021


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

            Bug ID: 49776
           Summary: missed optimization for dead code elimination at -O3
                    (vs. -O2)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Interprocedural Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: zhendong.su at inf.ethz.ch
                CC: llvm-bugs at lists.llvm.org

[621] % clangtk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
9fb0025f7084db14d16fe5cbe1d799f4ee0020af)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/suz-local/opfuzz/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
[622] %
[622] % clangtk -O2 -S -o O2.s small.c
[623] % clangtk -O3 -S -o O3.s small.c
[624] %
[624] % wc O2.s O3.s
 113  311 2972 O2.s
 270  736 6136 O3.s
 383 1047 9108 total
[625] %
[625] % grep foo O2.s
[626] % grep foo O3.s
        callq   foo
[627] %
[627] % cat small.c
extern void foo(void);
int a, b, c, d;
static int e;
volatile int f;
int main() {
  if (1 & e)
    foo();
  for (; a; a++)
    e = 1;
  for (b = 0; b < 16; b++)
    c = c && (c % d) && f;
  e = 2;
  return 0;
}

-- 
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/20210330/41546a5f/attachment.html>


More information about the llvm-bugs mailing list