[all-commits] [llvm/llvm-project] d13d9d: [clang] [ARM] Don't set the strict alignment flag ...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Fri Sep 17 11:41:43 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d13d9da1fbe1a750f9c4fc3f4da31c9d16a530d3
      https://github.com/llvm/llvm-project/commit/d13d9da1fbe1a750f9c4fc3f4da31c9d16a530d3
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-09-17 (Fri, 17 Sep 2021)

  Changed paths:
    M clang/lib/Driver/ToolChains/Arch/ARM.cpp
    M clang/test/Driver/arm-alignment.c

  Log Message:
  -----------
  [clang] [ARM] Don't set the strict alignment flag for armv7 on Windows

Windows on armv7 is as alignment tolerant as Linux.

The alignment considerations in the Windows on ARM ABI are documented
at https://docs.microsoft.com/en-us/cpp/build/overview-of-arm-abi-conventions?view=msvc-160#alignment.

The document doesn't explicitly say in which state the OS configures
the SCTLR.A register (and it's not accessible from user space to
inspect), but in practice, unaligned loads/stores do work and seem
to be as fast as aligned loads and stores. (Unaligned strd also does
seem to work, contrary to Linux, but significantly slower, as they're
handled by the kernel - exactly as the document describes.)

Differential Revision: https://reviews.llvm.org/D109960




More information about the All-commits mailing list