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

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 29 08:05:33 PDT 2016


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