[PATCH] D95141: [InstCombine] Remove unused llvm.experimental.noalias.scope.decl

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 23 13:52:37 PST 2021


nikic added a comment.

> During the analysis of !alias.scope and !nolias : when a 'list of scopes' was already analysed we do not need to go over it again.

I would expect that analysing scope list multiple times isn't really what's causing the compile-time hit here. It's probably the fact that you're looking up two kinds of metadata for each instruction, and metadata lookup is pretty expensive. You might want to check what the impact is if you only analyze mayReadOrWriteMemory() instructions.



================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:3804
+        II->getOperand(Intrinsic::NoAliasScopeDeclScopeArg));
+    const MDNode *MD = cast<MDNode>(MV->getMetadata());
+    assert(MD->getNumOperands() == 1 &&
----------------
I've just pushed a `NoAliasScopeDeclInst` class to make this kind of code nicer.

```
auto *Decl = dyn_cast<NoAliasScopeDeclInst>(Inst);
if (!Decl)
  return false;

const MDNode *MD = Decl->getScopeList();
```


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

https://reviews.llvm.org/D95141



More information about the llvm-commits mailing list