<div dir="ltr"><div><div><div><div><div><div><div><div>Hi,<br><br></div>I need to replace all uses of load instructions with the value of its operand. Here is an example:<br><br></div>%16 = load i32, i32* %x<br><br></div>%add = add i32 4, %16<br><br></div>In this case, i would like to have the result as:<br><br></div>%add = add i32 4, %x<br><br></div>and then delete the load instruction. I have tried replaceAllUsesWithValue but i get a type problem.<br><br>"llvm::Value::replaceAllUsesWith(llvm::Value*): Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed."<br><br></div>Best,<br></div>Mohammad<br></div>