|
|
|
|
|
by HappyTypist
3938 days ago
|
|
LLVM converts your input language into the intermediate representation (LLVM IR) with a frontend. Then, a backend takes IR and spits out code for an ISA. IR is ISA agnostic. Compiling the same code to x86 and ARM will have the same IR, it's only the backend step that's different. Thus, of course you can take IR "meant for ARM" and compile it to "x86" and get full optimisation. The IR isn't meant for ARM anyway, IR is just IR. |
|
This is incorrect. Clang has specific code paths (producing different IR) for x86 and ARM, specifically around calling conventions but I'm sure there are more.