<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 5/1/15 11:11 AM, Zhoulai wrote:<br>
</div>
<blockquote
cite="mid:CAKV0nkeLtqduffQP3u5zH7deHnrWjPook2Z8U80sN_E0o_Nd0g@mail.gmail.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html;
charset=ISO-8859-1">
<div dir="ltr">
<div>Hi, all</div>
<div><br>
</div>
<div>I am writing an LLVM pass in which I need to convert an
llvm::ICmpInst, denoted by ‘inst’ below, to llvm::FCmpInst. </div>
<div><br>
</div>
<div>My current approach is somewhat clumsy: I first retrieve
the operands of ‘inst’, then convert those operands of int
type to double typed values, and then create a new
llvm::FCmpInst with the double typed values. This is clumsy
because I also need to determine the different types of the
integer operands, such as int32, int64, etc. </div>
<div><br>
</div>
<div>So, is there a simpler way to convert an llvm::ICmpInst to
llvm::FCmpInst? Thanks.</div>
</div>
</blockquote>
<br>
There is not a way of which I am aware. Because you cannot convert
an instruction from one type of instruction to another type of
instruction, the only way to do what you're suggesting is to create
a new FCmpInst and to replace the uses of the ICmpInst with the
FCmpInst.<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
<blockquote
cite="mid:CAKV0nkeLtqduffQP3u5zH7deHnrWjPook2Z8U80sN_E0o_Nd0g@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Sincerely,<br>
</div>
<div>
<div>Zhoulai</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
</body>
</html>