[clang] Implement -falign-loops=N (N is a power of 2) for non-LTO
authorFangrui Song <i@maskray.me>
Thu, 5 Aug 2021 19:17:50 +0000 (12:17 -0700)
committerFangrui Song <i@maskray.me>
Thu, 5 Aug 2021 19:17:50 +0000 (12:17 -0700)
commitc38efb4899eac7b82daaf1320ad79f6271f9648a
treea6166c8877ef6c71c0fa48942585ca5089312f54
parent4d293f215dfb6ab6af966175717e86468f708b1c
[clang] Implement -falign-loops=N (N is a power of 2) for non-LTO

GCC supports multiple forms of -falign-loops=.
-falign-loops= is currently ignored in Clang.

This patch implements the simplest but the most useful form where N is a
power of 2.

The underlying implementation uses a `llvm::TargetOptions` option for now.
Bitcode generation ignores this option.

Differential Revision: https://reviews.llvm.org/D106701
clang/include/clang/Basic/CodeGenOptions.def
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Driver/Options.td
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/CodeGen/align-loops.c [new file with mode: 0644]
clang/test/Driver/clang_f_opts.c
clang/test/Driver/falign-loops.c [new file with mode: 0644]