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/MachineBlockPlacement.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp') diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp index fcddf346cf6..f5e30564501 100644 --- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp +++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp @@ -62,6 +62,11 @@ static cl::opt AlignAllBlock("align-all-blocks", "blocks in the function."), cl::init(0), cl::Hidden); +static cl::opt + AlignAllLoops("align-all-loops", + cl::desc("Force the alignment of all loops in the function."), + cl::init(0), cl::Hidden); + // FIXME: Find a good default for this flag and remove the flag. static cl::opt ExitBlockBias( "block-placement-exit-block-bias", @@ -1329,6 +1334,11 @@ void MachineBlockPlacement::buildCFGChains(MachineFunction &F) { if (!L) continue; + if (AlignAllLoops) { + ChainBB->setAlignment(AlignAllLoops); + continue; + } + unsigned Align = TLI->getPrefLoopAlignment(L); if (!Align) continue; // Don't care about loop alignment. -- cgit v1.2.3