<div dir="ltr"><div>BasicBlock::iterator bit = BB->begin();<br></div><div><br></div><div>LoadInst *li = = dyn_cast<LoadInst>(bit);</div><div><br></div><div>li->dump(); // %tmp6 = load i32* getelementptr inbounds (%struct.node* @Node, i32 0, i32 0), align 4, !dbg !59</div><div><br></div><div>li->getOperand(0)->dump(); // i32* getelementptr inbounds (%struct.node* @Node, i32 0, i32 0), align 4, !dbg !59</div><div><br></div><div>GetElementPtrInst *gep = dyn_cast<GetElementPtrInst>(li->getOperand(0));<br></div><div><br></div><div><div>if (gep != NULL) {</div><div><span class="" style="white-space:pre">  </span>std::cout << "gep not NULL" << std::endl;</div><div>}</div></div><div><br></div><div>The previous codes' BB is a BasicBlock pointer, I want to get the string name Node. I want to use dyn_cast to cast</div><div><br></div><div>the value of li->getOperand(0) to a GetElementPtr pointer type, but it is likely can not casted by the dyn_cast operation.</div><div><br></div><div>The if statement never executed. How it can be implemented? I confused by the load instruction? Any advice would be</div><div><br></div><div>appreciate, thank you.</div></div>