3 ms·
I can't see this as a definitive sign that Apple are going to introduce a new ISA. Instead, this gives them flexibility. They can switch ISAs (e.g. to a new ARM
by joosters 11y ago
I can't see this as a definitive sign that Apple are going to introduce a new ISA. Instead, this gives them flexibility. They can switch ISAs (e.g. to a new ARM revision, it doesn't have to be an Apple-specific one though) without authors having to recompile their code for all platforms. It also allows Apple to support multiple ISAs without code bloat - the app store can download the correct binary to your phone, just like they now can send only the correct size images.
I don't know how abstract the LLVM IR is - can you take IR and compile it to two wildly different ISAs, (say) x86 and ARM, and get full optimisation on both? Or is it more limited, e.g. allowing you to compile to ARM version x and ARM version y (e.g. if version 'y' supports some new SIMD instructions).
- HappyTypist 11y agoLLVM 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.
- gchadwick 11y ago> Compiling the same code to x86 and ARM will have the same 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.
- riscy 11y ago> IR is ISA agnostic It's absolutely ISA specific and this target independence pipe dream keeps being repeated on HN. Just search the LLVM documentation for "target specific."