<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 7/10/13 1:35 PM, Eirini _ wrote:<br>
</div>
<blockquote cite="mid:DUB108-W60AC5B497B641E7F8DE12BEA7A0@phx.gbl"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<div dir="ltr"><span style="color: rgb(68, 68, 68); font-size:
15px; line-height: 21px;">Hi,</span>
<div style="line-height: 21px; color: rgb(68, 68, 68);
font-size: 15px;"><br>
</div>
<div style="line-height: 21px; color: rgb(68, 68, 68);
font-size: 15px;"> i would like to ask you, if i can get a
lower-level representation than the llvm IR.</div>
<div style="line-height: 21px; color: rgb(68, 68, 68);
font-size: 15px;">For example, having the following
instruction in the llvm IR, </div>
<div style="line-height: 21px; color: rgb(68, 68, 68);
font-size: 15px;"> call void @llvm.memcpy.i32(i8* %19, i8*
getelementptr inbounds ([2 x [2 x [3 x i8]]]* @main.s, i32 0,
i32 0, i32 0, i32 0), i32 12, i32 1)</div>
</div>
</blockquote>
<br>
As Tim has pointed out, the "nested" getelementptr isn't really a
nested instruction. It is a compile-time constant. The reason why
it looks like a GEP is that it is in a symbolic form.<br>
<br>
If you really want to convert these constants into instructions,
take a look at the BreakConstantGEPs pass in SAFECode. It converts
some (but not all) constant expressions into LLVM instructions and
will alleviate the "nesting" that you see.<br>
<br>
As Tim also said, this conversion is not an optimization. You
should not expect the resulting IR to compile into efficient code.<br>
<br>
-- John T.<br>
<br>
<blockquote cite="mid:DUB108-W60AC5B497B641E7F8DE12BEA7A0@phx.gbl"
type="cite">
<div dir="ltr">
<div style="line-height: 21px; color: rgb(68, 68, 68);
font-size: 15px;"><br>
</div>
<div style="line-height: 21px; color: rgb(68, 68, 68);
font-size: 15px;">i would like to get something like this (in <u>A-normal
form</u> (without nested instructions):</div>
<div style="line-height: 21px; color: rgb(68, 68, 68);
font-size: 15px;"><b>%temp</b> = <span style="line-height:
22px; font-size: 12pt;"> </span><span style="line-height:
22px; font-size: 12pt;">i8* getelementptr inbounds ([2 x [2
x [3 x i8]]]* @main.s, i32 0, i32 0, i32 0, i32 0)</span></div>
<div style="line-height: 21px; color: rgb(68, 68, 68);
font-size: 15px;"> call void @llvm.memcpy.i32(i8* %19,<b> %temp</b>,
i32 12, i32 1)</div>
<div style="line-height: 21px; color: rgb(68, 68, 68);
font-size: 15px;"><br>
</div>
<div style="line-height: 21px; color: rgb(68, 68, 68);
font-size: 15px;"><br>
</div>
<div style="line-height: 21px; color: rgb(68, 68, 68);
font-size: 15px;">Thanks</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>
</body>
</html>