[PATCH] D55666: [Transforms] Preserve access metadata.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 13 12:25:42 PST 2018


Meinersbur created this revision.
Meinersbur added reviewers: hfinkel, pekka.jaaskelainen.

The `changeToCall` function did not preserve the invoke's metadata. Whether a call or invoke, the callee will access the same elements and therefore we can preserve the loop-parallel access metadata.

Copy the llvm.mem.parallel_loop_access from the invoke instruction before replacing it.

This fixes http://llvm.org/PR39994

Suggested-by: Moritz Kreutzer <moritz.kreutzer at siemens.com>


Repository:
  rL LLVM

https://reviews.llvm.org/D55666

Files:
  lib/Transforms/Utils/Local.cpp


Index: lib/Transforms/Utils/Local.cpp
===================================================================
--- lib/Transforms/Utils/Local.cpp
+++ lib/Transforms/Utils/Local.cpp
@@ -1970,6 +1970,7 @@
   NewCall->setCallingConv(II->getCallingConv());
   NewCall->setAttributes(II->getAttributes());
   NewCall->setDebugLoc(II->getDebugLoc());
+  NewCall->copyMetadata(*II, LLVMContext::MD_mem_parallel_loop_access);
   II->replaceAllUsesWith(NewCall);
 
   // Follow the call by a branch to the normal destination.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55666.178116.patch
Type: text/x-patch
Size: 512 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181213/1bd1a8ff/attachment.bin>


More information about the llvm-commits mailing list