[llvm-dev] Inconsistency in -march option between llc and clang

Suprateeka R Hegde via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 29 09:20:11 PDT 2016

I am OK with this explanation -- not to polish the user-interface of llc 
  as it is not supposed to be a user-facing tool.

But this needs to be documented well. Package developers need to very 
well understand this, Today I see that llc is used quite a lot of places 
specially in system software development. For instance, POCL (Portable 
OpenCL) uses clang and llc both. But tries to use the same value for 
-march and fails.


On 29-Aug-2016 08:35 PM, Tim Northover wrote:
> On 29 August 2016 at 06:17, Suprateeka R Hegde via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
>> On AArch64 (ARM 64-Bit Platform), I see there is an inconsistency in the
>> values accepted by -march option between clang and llc.
> This is because Clang has a triple which provides the primary context
> for interpreting -march. armv8a is a valid -march in both AArch32 and
> AArch64 modes.
> llc, on the other hand, uses -march as an abbreviated way to choose
> the primary triple. It accepts a more limited set of options (arm,
> thumb, arm64 or aarch64). It's not supposed to be a user-facing tool
> though, so as long as there's a way to get the configuration you want
> giving it a sophisticated interface isn't a priority (and arguably not
> even desirable).
> For llc, you probably want to use things like "-mattr=+v8.1a" to
> specify architecture revisions (v8a is the default, since it's the
> first 64-bit ARM version). And use either a full triple like
> "-mtriple=aarch64-linux-gnu", or "-march=aarch64" if you don't care
> what OS gets targeted (be careful there: tests vary subtly between iOS
> and Linux and can break depending on the host machine if you're not
> careful).
> Cheers.
> Tim.

More information about the llvm-dev mailing list