Skip to content

Commit cc0de2d

Browse files
committed
updates LLVM implementation to recent changes
1 parent 9d62b8f commit cc0de2d

2 files changed

Lines changed: 7 additions & 16 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ if(NOT TARGET scc-util)
4848
FetchContent_Declare(
4949
scc_git
5050
GIT_REPOSITORY https://github.com/Minres/SystemC-Components.git
51-
GIT_TAG 7be5ff5
51+
GIT_TAG 114b2e43
5252
)
5353
FetchContent_GetProperties(scc_git)
5454

src/iss/llvm/vm_base.h

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
#define LLVM_VM_BASE_H_
3737

3838
#include "jit_helper.h"
39-
#include <absl/container/flat_hash_map.h>
4039
#include <iss/arch/traits.h>
4140
#include <iss/arch_if.h>
4241
#include <iss/debugger/target_adapter_base.h>
4342
#include <iss/debugger_if.h>
43+
#include <iss/log_categories.h>
4444
#include <iss/vm_if.h>
4545
#include <iss/vm_plugin.h>
4646
#include <util/ities.h>
@@ -55,9 +55,8 @@
5555
#include <array>
5656
#include <chrono>
5757
#include <iostream>
58-
#include <map>
59-
#include <sstream>
60-
#include <stack>
58+
#include <unordered_map>
59+
6160
#include <utility>
6261
#include <vector>
6362

@@ -214,8 +213,8 @@ template <typename ARCH> class vm_base : public debugger_if, public vm_if {
214213
auto elapsed = end - start;
215214
auto millis = std::chrono::duration_cast<std::chrono::milliseconds>(elapsed).count();
216215
uint64_t& cur_icount = get_reg<uint64_t>(reg_e::ICOUNT);
217-
CLOG(INFO) << "Executed " << cur_icount << " instructions in " << func_map.size(, dbt_rise_iss) << " code blocks during " << millis
218-
<< "ms resulting in " << (cur_icount * 0.001 / millis) << "MIPS";
216+
CLOG(INFO, dbt_rise_iss) << "Executed " << cur_icount << " instructions in " << func_map.size() << " code blocks during " << millis
217+
<< "ms resulting in " << (cur_icount * 0.001 / millis) << "MIPS";
219218
return error;
220219
}
221220

@@ -362,14 +361,6 @@ template <typename ARCH> class vm_base : public debugger_if, public vm_if {
362361
builder.CreateCall(mod->getFunction("set_flag"), args);
363362
}
364363

365-
inline void gen_update_flags(iss::arch_if::operations op, Value* oper1, Value* oper2) {
366-
std::vector<Value*> args{
367-
core_ptr, ConstantInt::get(::iss::llvm::getContext(), APInt(16, op)),
368-
oper1->getType()->getScalarSizeInBits() == 64 ? oper1 : builder.CreateZExt(oper1, IntegerType::get(mod->getContext(), 64)),
369-
oper2->getType()->getScalarSizeInBits() == 64 ? oper2 : builder.CreateZExt(oper2, IntegerType::get(mod->getContext(), 64))};
370-
builder.CreateCall(mod->getFunction("update_flags"), args);
371-
}
372-
373364
inline Value* gen_read_mem(mem_type_e type, uint64_t addr, uint32_t length, const char* nm = "") {
374365
return gen_read_mem(type, gen_const(64, addr), length, nm);
375366
}
@@ -551,7 +542,7 @@ template <typename ARCH> class vm_base : public debugger_if, public vm_if {
551542
unsigned cluster_id = 0;
552543
uint8_t* regs_base_ptr;
553544
sync_type sync_exec{sync_type::NO_SYNC};
554-
absl::flat_hash_map<uint64_t, translation_block> func_map;
545+
std::unordered_map<uint64_t, translation_block> func_map;
555546
IRBuilder<> builder{iss::llvm::getContext()};
556547
// non-owning pointers
557548
Module* mod{nullptr};

0 commit comments

Comments
 (0)