<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 15, 2016, at 3:56 PM, Wolfgang McSneed 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="">Hi,</div><div class=""><br class=""></div><div class="">I am hoping that someone can help me figure out how to prevent the insertion of "memcpy" from the assembly source. </div><div class=""><br class=""></div><div class="">My target is an instruction set simulator that doesn't support this.</div><div class=""><br class=""></div><div class="">Thank you for your valuable time.</div><div class=""><br class=""></div><div class="">Wolf</div><div class=""><br class=""></div><div class=""><b class="">Here are my compile commands:</b></div><div class="">$ clang -emit-llvm -fno-builtin -o3 --target=mips -S matrix_float.c -o vl_matrix_float.ll<br class=""></div></div></div></blockquote><div><br class=""></div><div>Technically -fno-bultin prevents the compiler from understand the memset in the original code. The right option to prevent the compiler from insert libc calls “out-of-the-blue” is -ffreestanding.</div><div><br class=""></div><div>However I thought that right now clang does not differentiate these, so your result is somehow strange.</div><div>Can you include the matrix_float.c source code?</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="">$ llc vl_matrix_float.ll <br class=""></div></div><div class=""><br class=""></div><div class=""><b class="">IR File Snip:</b></div><div class=""><div class=""> %0 = bitcast [10 x [10 x float]]* %a to i8*</div><div class=""> call void @llvm.memcpy.p0i8.p0i8.i32(i8* %0, i8* bitcast ([10 x [10 x float]]* @main.a to i8*), i32 400, i32 4, i1 false)</div><div class=""> %1 = bitcast [10 x [10 x float]]* %b to i8*</div><div class=""> call void @llvm.memcpy.p0i8.p0i8.i32(i8* %1, i8* bitcast ([10 x [10 x float]]* @main.b to i8*), i32 400, i32 4, i1 false)</div><div class=""> store i32 0, i32* %sum, align 4</div></div><div class=""><br class=""></div><div class=""><b class="">Assembly File Snip:</b></div><div class=""><br class=""></div><div class=""><div class=""># BB#0: # %entry</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>lui<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$2, %hi(_gp_disp)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>addiu<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$2, $2, %lo(_gp_disp)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>addiu<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$sp, $sp, -1664</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>sw<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$ra, 1660($sp) # 4-byte Folded Spill</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>sw<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$fp, 1656($sp) # 4-byte Folded Spill</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>sw<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$17, 1652($sp) # 4-byte Folded Spill</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>sw<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$16, 1648($sp) # 4-byte Folded Spill</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>move<span class="gmail-Apple-tab-span" style="white-space:pre"> </span> $fp, $sp</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>addu<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$17, $2, $25</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>lw<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$1, %got($main.a)($17)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>addiu<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$5, $1, %lo($main.a)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>lw<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$25, %call16(memcpy)($17)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>addiu<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$16, $fp, 1248</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>move<span class="gmail-Apple-tab-span" style="white-space:pre"> </span> $4, $16</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>addiu<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$6, $zero, 400</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>jalr<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$25</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>move<span class="gmail-Apple-tab-span" style="white-space:pre"> </span> $gp, $17</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>lw<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$1, %got($main.b)($17)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>addiu<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$5, $1, %lo($main.b)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>lw<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$25, %call16(memcpy)($17)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>addiu<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$17, $fp, 848</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>move<span class="gmail-Apple-tab-span" style="white-space:pre"> </span> $4, $17</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>jalr<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$25</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>addiu<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$6, $zero, 400</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>sw<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$zero, 820($fp)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>sw<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$zero, 844($fp)</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>addiu<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$2, $fp, 420</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>b<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$BB0_2</div><div class=""><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>addiu<span class="gmail-Apple-tab-span" style="white-space:pre"> </span>$3, $fp, 20</div><div class="">$BB0_1:</div></div><div class=""><br class=""></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="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>