[CodeGen] Add -align-loops
authorFangrui Song <i@maskray.me>
Wed, 4 Aug 2021 19:45:17 +0000 (12:45 -0700)
committerFangrui Song <i@maskray.me>
Wed, 4 Aug 2021 19:45:18 +0000 (12:45 -0700)
commita1944386156dbbfae15dfc606a3728e08ac92cfe
tree25fda9656217854430368d6e913d350d077e9c71
parent5edc886e900b12286ad86268461a3013c329118d
[CodeGen] Add -align-loops

to `lib/CodeGen/CommandFlags.cpp`. It can replace
-x86-experimental-pref-loop-alignment=.

The loop alignment is only used by MachineBlockPlacement.
The implementation uses a new `llvm::TargetOptions` for now, as
an IR function attribute/module flags metadata may be overkill.

This is the llvm part of D106701.
llvm/include/llvm/CodeGen/CommandFlags.h
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/include/llvm/Target/TargetOptions.h
llvm/lib/CodeGen/CommandFlags.cpp
llvm/lib/CodeGen/TargetLoweringBase.cpp
llvm/test/CodeGen/RISCV/align-loops.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/innermost-loop-alignment.ll