[PATCH] D48832: [ARM] ARMCodeGenPrepare backend pass

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 3 03:19:20 PDT 2018


samparker added inline comments.


================
Comment at: lib/Target/ARM/ARMCodeGenPrepare.cpp:184
+
+  if (isa<StoreInst>(V) || isa<TerminatorInst>(V))
+    return false;
----------------
SjoerdMeijer wrote:
> I learned a trick the other day: the IR pattern matcher. ;-) Looks like you can simply things, and don't need the check and cast above and can immediately do something like:
> 
>    if (match(V, m_Store(m_Value(), m_Value())) || isa<TerminatorInst>(V))
>      return false;
> 
> Looks like you can actually use the pattern matcher at more places, like e.g. the function below.
I don't see how the match function is better than isa<> here. The cases below are mainly concerned with checking the number of uses, can the pattern matching framework help there?


https://reviews.llvm.org/D48832





More information about the llvm-commits mailing list