[PATCH] D93040: [InlineFunction] Use llvm.experimental.noalias.scope.decl for noalias arguments.

Nikita Popov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 1 03:27:40 PST 2021


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/InlineFunction.cpp:929
 
-    if (MDNode *M = NI->getMetadata(LLVMContext::MD_alias_scope))
-      NI->setMetadata(LLVMContext::MD_alias_scope, MDMap[M]);
+    if (MDNode *M = I->getMetadata(LLVMContext::MD_alias_scope))
+      I->setMetadata(LLVMContext::MD_alias_scope, MDMap[M]);
----------------
jeroen.dobbelaere wrote:
> @nikic In the full restrict patches, we also check if the instruction was already handled. I was able to trigger this with an assertion and I have a more or less reduced testcase.
> 
> Either we keep a SmallPtrSet and check if the instruction was already handled (this is what the full restrict version does; See D68509 InlineFunction.cpp#969). Or we only replace the metadata if it is in the MDMap (by using MDMap.lookup(M).
> 
> Any preference ?
> 
I don't understand under what circumstances we'd handle an instruction twice.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93040/new/

https://reviews.llvm.org/D93040



More information about the cfe-commits mailing list