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

            Bug ID: 26990
           Summary: -fno-builtin and -fno-builtin-foo disable
                    optimizations that introduce builtin calls (e.g., LIR)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
    Classification: Unclassified

The -fno-builtin option says don't recognize built-in functions that do not
begin with __builtin__ as a prefix.  This is done to prevent the compiler from
optimizing such calls in the original program.  However, it isn't clear to me
(or Duncan or Bob) that this should prevent the compiler from introducing new
calls to builtin functions.

For example, this bit of code is recognized by the loop idiom pass as a memset:

void foo(int *arr) {
  for (unsigned i = 0; i < 8192; ++i)
    arr[i] = 0;
}

When compiling with gcc, the -fno-builtin and -fno-builtin-memset options don't
prevent gcc from converting this loop into a memset:

$> aarch64-linux-gnu-gcc -O3 test.c -o - -S -fno-builtin-memset | grep memset
     b    memset

However, the same is not true when compiling with LLVM.

-- 
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