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

            Bug ID: 37341
           Summary: Missed optimization: optimize unnecessary std::sort
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

clang trunk with -O3 for code below doesn't optimize std::sort (compiler must
remove it from output binary):


#include <algorithm>
#include <numeric>

void foo(int* a, int size)
{
    std::sort(a, a + size);
}

int bar(int* a, int b)
{
    foo(a, b);
    return std::accumulate(a, a + b, 0);
}


GCC has similar behaviour. Is it possible to optimize it?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to