<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi Abid,</div><div class=""><br class=""></div><div class="">I don't work on the LLVM-IR level very often so this may be incorrect but I believe you're looking for either:</div>    val.replaceAllUsesWith(val2)<div class="">or:</div><div class="">    instruction.getOperandUse(Index).set(val2)</div><div class=""><br class=""></div><div class="">The first one should change all instructions that use val2 so that they use val instead. The second should change one specific operand of an instruction to use val2 instead.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 29, 2020, at 12:24, Abid Malik via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><br clear="all" class=""></div><div class=""><div class="gmail_default" style="font-family:"courier new",monospace;font-size:small">Does it mean we can not dereference the Value variables?</div><div class="gmail_default" style="font-family:"courier new",monospace;font-size:small"><br class=""></div><div class="gmail_default" style="font-family:"courier new",monospace;font-size:small">Value *val = some operand of an instruction;</div><div class="gmail_default" style="font-family:"courier new",monospace;font-size:small">Value *val2=  some operand of another instruction;</div><div class="gmail_default" style="font-family:"courier new",monospace;font-size:small"><br class=""></div><div class="gmail_default" style="font-family:"courier new",monospace;font-size:small">I am trying to rewire the operand values of an instruction using:</div><div class="gmail_default" style="font-family:"courier new",monospace;font-size:small"><br class=""></div><div class="gmail_default" style="font-family:"courier new",monospace;font-size:small">*val = *val2;</div><div class="gmail_default" style="font-family:"courier new",monospace;font-size:small"><br class=""></div><div class="gmail_default" style="font-family:"courier new",monospace;font-size:small">It seems that this is not allowed.</div><div class="gmail_default" style="font-family:"courier new",monospace;font-size:small"><br class=""></div><div class="gmail_default" style="font-family:"courier new",monospace;font-size:small">Thanks,</div><br class=""></div>-- <br class=""><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class="">Abid M. Malik<br class="">******************************************************<br class="">"I have learned silence from the talkative, toleration from the intolerant, and kindness from the unkind"---Gibran<br class="">"Success is not for the chosen few, but for the few who choose" --- John Maxwell<br class="">"Being a good person does not depend on your religion or status in life, your race or skin color, political views or culture. IT DEPENDS ON HOW GOOD YOU TREAT OTHERS"--- Abid<br class="">"The Universe is talking to us, and the language of the Universe is mathematics."----Abid<br class=""> </div></div></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>