llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.61k stars 11.82k forks source link

Incredibly slow compilation of inline-assembly-heavy C++ code #23740

Open llvmbot opened 9 years ago

llvmbot commented 9 years ago
Bugzilla Link 23366
Version 3.6
OS MacOS X
Attachments OS X Activity Monitor sample of the clang process
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

In our project we have a single C++ file that contains very large amounts of inline assembly code.

It used to take no noticeable time to compile this (< 1 second), but after upgrading to LLVM 3.6 (Apple LLVM 6.1 in Xcode), it's taking tens of minutes. I'm guessing roughly 30 minutes on this MacBook:

2.2 GHz Intel Core i7 8 GB 1333 MHz DDR3

I'm not at liberty to share the code, however after some testing, it looks like it might be down to just the quantity of inline assembly code.

On profiling the clang process, the function clang::GCCAsmStmt::AnalyzeAsmString() seems to be doing all the work. Call stack from OS X Activity Monitor is attached.

llvmbot commented 9 years ago

Oh btw, the target platform is ARM64, and the language dialect is C++14. Spell checking is turned off.