diff options
| author | Guillaume Chatelet <gchatelet@google.com> | 2018-10-01 11:46:06 +0000 |
|---|---|---|
| committer | Guillaume Chatelet <gchatelet@google.com> | 2018-10-01 11:46:06 +0000 |
| commit | c6268f3ba2c5c3d33e32534f7b602aa396982cdb (patch) | |
| tree | 9c25037754d79a2035cbfb1d52b878135b2e0791 /llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp | |
| parent | b048fa33446c99c53f33be3201c5c9dbdf5eae4e (diff) | |
| download | bcm5719-llvm-c6268f3ba2c5c3d33e32534f7b602aa396982cdb.tar.gz bcm5719-llvm-c6268f3ba2c5c3d33e32534f7b602aa396982cdb.zip | |
[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
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp')
| -rw-r--r-- | llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp b/llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp index f3111797993..677bddd10b8 100644 --- a/llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp +++ b/llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp @@ -67,15 +67,6 @@ bool InstructionTemplate::hasImmediateVariables() const { }); } -void InstructionTemplate::randomizeUnsetVariables( - const llvm::BitVector &ForbiddenRegs) { - for (const Variable &Var : Instr.Variables) { - llvm::MCOperand &AssignedValue = getValueFor(Var); - if (!AssignedValue.isValid()) - randomize(Instr, Var, AssignedValue, ForbiddenRegs); - } -} - llvm::MCInst InstructionTemplate::build() const { llvm::MCInst Result; Result.setOpcode(Instr.Description->Opcode); @@ -161,4 +152,13 @@ void setRandomAliasing(const AliasingConfigurations &AliasingConfigurations, setRegisterOperandValue(randomElement(RandomConf.Uses), UseIB); } +void randomizeUnsetVariables(const llvm::BitVector &ForbiddenRegs, + InstructionTemplate &IT) { + for (const Variable &Var : IT.Instr.Variables) { + llvm::MCOperand &AssignedValue = IT.getValueFor(Var); + if (!AssignedValue.isValid()) + randomize(IT.Instr, Var, AssignedValue, ForbiddenRegs); + } +} + } // namespace exegesis |

