@@ -49,10 +49,11 @@ static const Align kFunctionAlignment(4096);
49
49
50
50
// Fills the given basic block with register setup code, and returns true if
51
51
// all registers could be setup correctly.
52
- static bool generateSnippetSetupCode (
53
- const ExegesisTarget &ET, const MCSubtargetInfo *const MSI,
54
- ArrayRef<RegisterValue> RegisterInitialValues, BasicBlockFiller &BBF,
55
- const BenchmarkKey &Key, bool GenerateMemoryInstructions) {
52
+ static bool generateSnippetSetupCode (const ExegesisTarget &ET,
53
+ const MCSubtargetInfo *const MSI,
54
+ BasicBlockFiller &BBF,
55
+ const BenchmarkKey &Key,
56
+ bool GenerateMemoryInstructions) {
56
57
bool IsSnippetSetupComplete = true ;
57
58
if (GenerateMemoryInstructions) {
58
59
BBF.addInstructions (ET.generateMemoryInitialSetup ());
@@ -75,7 +76,7 @@ static bool generateSnippetSetupCode(
75
76
Register StackPointerRegister = BBF.MF .getSubtarget ()
76
77
.getTargetLowering ()
77
78
->getStackPointerRegisterToSaveRestore ();
78
- for (const RegisterValue &RV : RegisterInitialValues) {
79
+ for (const RegisterValue &RV : Key. RegisterInitialValues ) {
79
80
if (GenerateMemoryInstructions) {
80
81
// If we're generating memory instructions, don't load in the value for
81
82
// the register with the stack pointer as it will be used later to finish
@@ -93,7 +94,7 @@ static bool generateSnippetSetupCode(
93
94
#ifdef HAVE_LIBPFM
94
95
BBF.addInstructions (ET.configurePerfCounter (PERF_EVENT_IOC_RESET, true ));
95
96
#endif // HAVE_LIBPFM
96
- for (const RegisterValue &RV : RegisterInitialValues) {
97
+ for (const RegisterValue &RV : Key. RegisterInitialValues ) {
97
98
// Load in the stack register now as we're done using it elsewhere
98
99
// and need to set the value in preparation for executing the
99
100
// snippet.
@@ -242,10 +243,8 @@ BitVector getFunctionReservedRegs(const TargetMachine &TM) {
242
243
243
244
Error assembleToStream (const ExegesisTarget &ET,
244
245
std::unique_ptr<LLVMTargetMachine> TM,
245
- ArrayRef<unsigned > LiveIns,
246
- ArrayRef<RegisterValue> RegisterInitialValues,
247
- const FillFunction &Fill, raw_pwrite_stream &AsmStream,
248
- const BenchmarkKey &Key,
246
+ ArrayRef<unsigned > LiveIns, const FillFunction &Fill,
247
+ raw_pwrite_stream &AsmStream, const BenchmarkKey &Key,
249
248
bool GenerateMemoryInstructions) {
250
249
auto Context = std::make_unique<LLVMContext>();
251
250
std::unique_ptr<Module> Module =
@@ -275,7 +274,7 @@ Error assembleToStream(const ExegesisTarget &ET,
275
274
}
276
275
277
276
std::vector<unsigned > RegistersSetUp;
278
- for (const auto &InitValue : RegisterInitialValues) {
277
+ for (const auto &InitValue : Key. RegisterInitialValues ) {
279
278
RegistersSetUp.push_back (InitValue.Register );
280
279
}
281
280
FunctionFiller Sink (MF, std::move (RegistersSetUp));
@@ -294,8 +293,7 @@ Error assembleToStream(const ExegesisTarget &ET,
294
293
}
295
294
296
295
const bool IsSnippetSetupComplete = generateSnippetSetupCode (
297
- ET, TM->getMCSubtargetInfo (), RegisterInitialValues, Entry, Key,
298
- GenerateMemoryInstructions);
296
+ ET, TM->getMCSubtargetInfo (), Entry, Key, GenerateMemoryInstructions);
299
297
300
298
// If the snippet setup is not complete, we disable liveliness tracking. This
301
299
// means that we won't know what values are in the registers.
0 commit comments