@@ -108,8 +108,7 @@ void instrument_function_if_needed(CUcontext ctx, CUfunction func) {
108108
109109 const std::vector<Instr *> &instrs = nvbit_get_instrs (ctx, f);
110110 if (verbose) {
111- printf (" Inspecting function %s at address 0x%lx\n " ,
112- nvbit_get_func_name (ctx, f), nvbit_get_func_addr (f), true );
111+ printf (" Inspecting function %s at address 0x%lx\n " , nvbit_get_func_name (ctx, f), nvbit_get_func_addr (f), true );
113112 }
114113
115114 uint32_t cnt = 0 ;
@@ -137,7 +136,7 @@ void instrument_function_if_needed(CUcontext ctx, CUfunction func) {
137136 nvbit_insert_call (instr, " instrument_inst" , IPOINT_BEFORE);
138137
139138 /* pass predicate value */
140- nvbit_add_call_arg_pred_val (instr);
139+ nvbit_add_call_arg_guard_pred_val (instr);
141140
142141 /* send opcode and pc */
143142 nvbit_add_call_arg_const_val32 (instr, opcode_id);
@@ -153,10 +152,10 @@ void instrument_function_if_needed(CUcontext ctx, CUfunction func) {
153152 /* find dst reg and handle the special case if the oprd[0] is mem (e.g.
154153 * store and RED)*/
155154 if (instr->getNumOperands () > 0 &&
156- instr->getOperand (0 )->type == Instr::operandType ::REG)
155+ instr->getOperand (0 )->type == InstrType::OperandType ::REG)
157156 dst_oprd = instr->getOperand (0 )->u .reg .num ;
158157 else if (instr->getNumOperands () > 0 &&
159- instr->getOperand (0 )->type == Instr::operandType ::MREF) {
158+ instr->getOperand (0 )->type == InstrType::OperandType ::MREF) {
160159 src_oprd[0 ] = instr->getOperand (0 )->u .mref .ra_num ;
161160 mem_oper_idx = 0 ;
162161 srcNum++;
@@ -165,16 +164,16 @@ void instrument_function_if_needed(CUcontext ctx, CUfunction func) {
165164 // find src regs and mem
166165 for (int i = 1 ; i < MAX_SRC; i++) {
167166 if (i < instr->getNumOperands ()) {
168- const Instr ::operand_t *op = instr->getOperand (i);
169- if (op->type == Instr::operandType ::MREF) {
167+ const InstrType ::operand_t *op = instr->getOperand (i);
168+ if (op->type == InstrType::OperandType ::MREF) {
170169 // mem is found
171170 assert (srcNum < MAX_SRC);
172171 src_oprd[srcNum] = instr->getOperand (i)->u .mref .ra_num ;
173172 srcNum++;
174173 // TO DO: handle LDGSTS with two mem refs
175174 assert (mem_oper_idx == -1 ); // ensure one memory operand per inst
176175 mem_oper_idx++;
177- } else if (op->type == Instr::operandType ::REG) {
176+ } else if (op->type == InstrType::OperandType ::REG) {
178177 // reg is found
179178 assert (srcNum < MAX_SRC);
180179 src_oprd[srcNum] = instr->getOperand (i)->u .reg .num ;
0 commit comments