[PATCH] D67346: Bug 43202 - ARM FastIsel is renaming the memcpy to memcpy.<random-number> in getLibcallReg().

Umesh Kalappa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 04:03:04 PDT 2019


umesh.kalappa0 created this revision.
umesh.kalappa0 added a reviewer: t.p.northover.
Herald added subscribers: llvm-commits, kristof.beyls.
Herald added a project: LLVM.

When we use the FastIsel in the ARM ,the memcpy was renamed with like memcpy.<Number> by GlobalVariable()

But its not the semantics we required in the getLibcallReg().


Repository:
  rL LLVM

https://reviews.llvm.org/D67346

Files:
  ARMFastISel.cpp


Index: ARMFastISel.cpp    
===================================================================
--- ARMFastISel.cpp    
+++ ARMFastISel.cpp    
@@ -2195,10 +2195,9 @@
   Type *GVTy = Type::getInt32PtrTy(*Context, /*AS=*/0);
   EVT LCREVT = TLI.getValueType(DL, GVTy);
   if (!LCREVT.isSimple()) return 0;
-
-  GlobalValue *GV = new GlobalVariable(M, Type::getInt32Ty(*Context), false,
-                                       GlobalValue::ExternalLinkage, nullptr,
-                                       Name);
+  GlobalValue *GV = cast <GlobalVariable>(M.getOrInsertGlobal(
+                                         Name.getSingleStringRef(),
+                                         Type::getInt32Ty(*Context)));
   assert(GV->getType() == GVTy && "We miscomputed the type for the global!");
   return ARMMaterializeGV(GV, LCREVT.getSimpleVT());
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67346.219313.patch
Type: text/x-patch
Size: 851 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190909/1bda45d8/attachment.bin>


More information about the llvm-commits mailing list