#include "bolt/Passes/JTFootprintReduction.h"
#include "bolt/Core/BinaryFunctionCallGraph.h"
#include "bolt/Passes/DataflowInfoManager.h"
#include "llvm/Support/CommandLine.h"
#define DEBUG_TYPE …
usingnamespacellvm;
usingnamespacebolt;
namespace opts {
extern cl::OptionCategory BoltOptCategory;
extern cl::opt<unsigned> Verbosity;
extern cl::opt<JumpTableSupportLevel> JumpTables;
static cl::opt<bool> JTFootprintOnlyPIC(
"jt-footprint-optimize-for-icache",
cl::desc("with jt-footprint-reduction, only process PIC jumptables and turn"
" off other transformations that increase code size"),
cl::init(false), cl::ZeroOrMore, cl::cat(BoltOptCategory));
}
namespace llvm {
namespace bolt {
void JTFootprintReduction::checkOpportunities(BinaryFunction &Function,
DataflowInfoManager &Info) { … }
bool JTFootprintReduction::tryOptimizeNonPIC(
BinaryContext &BC, BinaryBasicBlock &BB, BinaryBasicBlock::iterator Inst,
uint64_t JTAddr, JumpTable *JumpTable, DataflowInfoManager &Info) { … }
bool JTFootprintReduction::tryOptimizePIC(BinaryContext &BC,
BinaryBasicBlock &BB,
BinaryBasicBlock::iterator Inst,
uint64_t JTAddr, JumpTable *JumpTable,
DataflowInfoManager &Info) { … }
void JTFootprintReduction::optimizeFunction(BinaryFunction &Function,
DataflowInfoManager &Info) { … }
Error JTFootprintReduction::runOnFunctions(BinaryContext &BC) { … }
}
}