<div dir="auto"><div>Hi Alex,<div dir="auto">Can't you just just if the first operand is a ConstantInt? If you need to differentiate only these 2 cases it should be fine.</div><div dir="auto"><br></div><div dir="auto">Thanks</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 22, 2019, 14:37 alexp via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
the store instruction allows to define values, e.g.:<br>
<br>
<br>
%ptr = alloca i32                               ; yields i32*:ptr<br>
store i32 3, i32* %ptr<br>
<br>
lets name this 'type1 store'; this is different from 'type2 store'<br>
<br>
%val = load i32, i32* %someptr<br>
%ptr = alloca i32                               ; yields i32*:ptr<br>
store %val, i32* %ptr                          ; yields void<br>
<br>
<br>
When now later on manipulating the instructions of a function, can I<br>
tell if I deal with type1 or type 2 store?<br>
<br>
In case of type1 I could e.g. alter the value; in type 2 not.<br>
<br>
My best guess is something like:<br>
storeInstructionInstance.getValueOperand.hasOneUse()<br>
 true: only used within this storeInstruction, else value is<br>
introduced/used elsewhere.<br>
<br>
Is this correct?<br>
<br>
Thanks!<br>
<br>
Alex<br>
<br>
<br>
<br>
<br>
p.s.:<br>
<br>
it's been a while since my last post to llvm-dev. Is this still the<br>
place for such questions? If not, pleas point me where to ask this sort<br>
of questions.<br>
Thanks<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div></div>