From c6268f3ba2c5c3d33e32534f7b602aa396982cdb Mon Sep 17 00:00:00 2001 From: Guillaume Chatelet Date: Mon, 1 Oct 2018 11:46:06 +0000 Subject: [llvm-exegesis][NFC] Make randomizeUnsetVariables a free function. Summary: This is prelimineary to moving random functions to SnippetGenerator. Reviewers: courbet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D52718 llvm-svn: 343456 --- llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp') diff --git a/llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp b/llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp index 6bfef1ee4ab..de57bf3fd70 100644 --- a/llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp +++ b/llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp @@ -35,16 +35,17 @@ llvm::Expected> SnippetGenerator::generateConfigurations(unsigned Opcode) const { if (auto E = generateCodeTemplate(Opcode)) { CodeTemplate &CT = E.get(); + const llvm::BitVector &ForbiddenRegs = + CT.ScratchSpacePointerInReg + ? RATC.getRegister(CT.ScratchSpacePointerInReg).aliasedBits() + : RATC.emptyRegisters(); std::vector Output; // TODO: Generate as many BenchmarkCode as needed. { BenchmarkCode BC; BC.Info = CT.Info; for (InstructionTemplate &IT : CT.Instructions) { - IT.randomizeUnsetVariables( - CT.ScratchSpacePointerInReg - ? RATC.getRegister(CT.ScratchSpacePointerInReg).aliasedBits() - : RATC.emptyRegisters()); + randomizeUnsetVariables(ForbiddenRegs, IT); BC.Instructions.push_back(IT.build()); } if (CT.ScratchSpacePointerInReg) -- cgit v1.2.3