summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp')
-rw-r--r--llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp b/llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp
index f538384f593..9d01c7d40b0 100644
--- a/llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp
+++ b/llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp
@@ -32,32 +32,30 @@ unsigned InstructionTemplate::getOpcode() const {
return Instr.Description->getOpcode();
}
-llvm::MCOperand &InstructionTemplate::getValueFor(const Variable &Var) {
+MCOperand &InstructionTemplate::getValueFor(const Variable &Var) {
return VariableValues[Var.getIndex()];
}
-const llvm::MCOperand &
-InstructionTemplate::getValueFor(const Variable &Var) const {
+const MCOperand &InstructionTemplate::getValueFor(const Variable &Var) const {
return VariableValues[Var.getIndex()];
}
-llvm::MCOperand &InstructionTemplate::getValueFor(const Operand &Op) {
+MCOperand &InstructionTemplate::getValueFor(const Operand &Op) {
return getValueFor(Instr.Variables[Op.getVariableIndex()]);
}
-const llvm::MCOperand &
-InstructionTemplate::getValueFor(const Operand &Op) const {
+const MCOperand &InstructionTemplate::getValueFor(const Operand &Op) const {
return getValueFor(Instr.Variables[Op.getVariableIndex()]);
}
bool InstructionTemplate::hasImmediateVariables() const {
- return llvm::any_of(Instr.Variables, [this](const Variable &Var) {
+ return any_of(Instr.Variables, [this](const Variable &Var) {
return Instr.getPrimaryOperand(Var).isImmediate();
});
}
-llvm::MCInst InstructionTemplate::build() const {
- llvm::MCInst Result;
+MCInst InstructionTemplate::build() const {
+ MCInst Result;
Result.setOpcode(Instr.Description->Opcode);
for (const auto &Op : Instr.Operands)
if (Op.isExplicit())
@@ -66,10 +64,10 @@ llvm::MCInst InstructionTemplate::build() const {
}
bool isEnumValue(ExecutionMode Execution) {
- return llvm::isPowerOf2_32(static_cast<uint32_t>(Execution));
+ return isPowerOf2_32(static_cast<uint32_t>(Execution));
}
-llvm::StringRef getName(ExecutionMode Bit) {
+StringRef getName(ExecutionMode Bit) {
assert(isEnumValue(Bit) && "Bit must be a power of two");
switch (Bit) {
case ExecutionMode::UNKNOWN:
@@ -92,7 +90,7 @@ llvm::StringRef getName(ExecutionMode Bit) {
llvm_unreachable("Missing enum case");
}
-llvm::ArrayRef<ExecutionMode> getAllExecutionBits() {
+ArrayRef<ExecutionMode> getAllExecutionBits() {
static const ExecutionMode kAllExecutionModeBits[] = {
ExecutionMode::ALWAYS_SERIAL_IMPLICIT_REGS_ALIAS,
ExecutionMode::ALWAYS_SERIAL_TIED_REGS_ALIAS,
@@ -102,12 +100,11 @@ llvm::ArrayRef<ExecutionMode> getAllExecutionBits() {
ExecutionMode::ALWAYS_PARALLEL_MISSING_USE_OR_DEF,
ExecutionMode::PARALLEL_VIA_EXPLICIT_REGS,
};
- return llvm::makeArrayRef(kAllExecutionModeBits);
+ return makeArrayRef(kAllExecutionModeBits);
}
-llvm::SmallVector<ExecutionMode, 4>
-getExecutionModeBits(ExecutionMode Execution) {
- llvm::SmallVector<ExecutionMode, 4> Result;
+SmallVector<ExecutionMode, 4> getExecutionModeBits(ExecutionMode Execution) {
+ SmallVector<ExecutionMode, 4> Result;
for (const auto Bit : getAllExecutionBits())
if ((Execution & Bit) == Bit)
Result.push_back(Bit);
OpenPOWER on IntegriCloud