From 6b4326367ad95c39d83236cd30fb3e734f865157 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Tue, 29 Dec 2015 18:18:07 +0000 Subject: Add command line options to force function/loop alignments. These are being added for testing purposes. http://reviews.llvm.org/D15648 llvm-svn: 256571 --- llvm/lib/CodeGen/MachineFunction.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 80d30a5..ca4bb1c 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -47,6 +47,11 @@ using namespace llvm; #define DEBUG_TYPE "codegen" +static cl::opt + AlignAllFunctions("align-all-functions", + cl::desc("Force the alignment of all functions."), + cl::init(0), cl::Hidden); + void MachineFunctionInitializer::anchor() {} //===----------------------------------------------------------------------===// @@ -87,6 +92,9 @@ MachineFunction::MachineFunction(const Function *F, const TargetMachine &TM, Alignment = std::max(Alignment, STI->getTargetLowering()->getPrefFunctionAlignment()); + if (AlignAllFunctions) + Alignment = AlignAllFunctions; + FunctionNumber = FunctionNum; JumpTableInfo = nullptr; -- cgit v1.1