Issue 66236
Summary Missing decorations for builtin library functions
Labels
Assignees
Reporter OfekShilon
    The library function `cos` redirects to `__builtin_cos`. It, and many others, could be treated as `__attribute__((const))` but aren't. Optimizations are missed as a result.

toy example:

```c
void whateva();
void pureFunc(double d) __attribute__((pure));

void fun(double d) {
    pureFunc(d);      // call eliminated in EarlyCSEPass
    __builtin_cos(d); // call never eliminated

 whateva();
}
```

https://godbolt.org/z/KP88hnxoP

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to