Skip to content

Not bug. Performance. Loop optimization. clang++ 1.6x slower than g++ #49645

@h0tc0d3

Description

@h0tc0d3
Bugzilla Link 50301
Version 12.0
OS Linux
Attachments Affected C++ Source

Extended Description

It this case https://pastebin.com/rhpWvssR

g++ -O2 fib.cpp -o /tmp/fib;clang++ -O2 -fdiagnostics-color=always fib.cpp -o /tmp/fib2;/tmp/fib;/tmp/fib2

GCC Execution time: 37.622s
Clag Execution time: 61.858s

With OMP and little bit change algo

GCC Execution time: ~23s
Clag Execution time: ~38s

GCC Version 10.2.0
LLVM 11.1.0 and 12.0.0 git branch

This also happens in more complex code. I simplified code for minimal instructions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions