[LLVMbugs] [Bug 17021] Recent CC_default change broke intrinsics?

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 28 13:35:02 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17021

Reid Kleckner <rnk at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Reid Kleckner <rnk at google.com> ---
The difference is that after my patch, we successfully recognize memcpy as a
builtin:

--- cc_after.ll 2013-08-28 13:16:19.875920600 -0700
+++ cc_before.ll        2013-08-28 13:16:26.360920600 -0700
@@ -53,7 +53,7 @@
   %call = call i8* @"\01?ident@@YAPAXPCX at Z"(i8* %arraydecay)
   %arraydecay1 = getelementptr inbounds [6 x i8]* %buff1, i32 0, i32 0
   %call2 = call i8* @"\01?ident@@YAPAXPCX at Z"(i8* %arraydecay1)
-  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %call, i8* %call2, i32 6, i32 1, i1
false)
+  %call3 = call i8* @memcpy(i8* %call, i8* %call2, i32 6)
   call void @"\01?UNREACHABLE@@YAXXZ"()
   ret i32 0
 }
@@ -61,6 +61,8 @@
 ; Function Attrs: nounwind
 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly,
i32, i32, i1) #2

+declare i8* @memcpy(i8*, i8*, i32) #1
+

Presumably LLVM lowers it to loads and stores.  Maybe if you put the function
pointer through ident() you'd get the original stack.

The weird thing is that this is not an LLVM optimization, it happens even with
-mllvm -disable-llvm-optzns and -O0.  It's something in clang.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130828/d38082c0/attachment.html>


More information about the llvm-bugs mailing list