[PATCH] D68013: [PatternMatch] Make m_Br more flexible, add matchers for BB values.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 03:46:16 PDT 2019


fhahn created this revision.
fhahn added reviewers: spatel, craig.topper, RKSimon, majnemer, lebedev.ri.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

Currently m_Br only takes references to BasicBlock*, which limits its
flexibility. For example, you have to declare a variable, even if you
ignore the result or you have to have additional checks to make sure the
matched BB matches an expected one.

This patch adds m_BasicBlock and m_SpecificBB matchers, which can be
used like the existing matchers for constants or values.

I also had a look at the existing uses and updated a few. IMO it makes
the code a bit more explicit.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68013

Files:
  llvm/include/llvm/IR/PatternMatch.h
  llvm/lib/Analysis/ScalarEvolutionExpander.cpp
  llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/unittests/IR/PatternMatch.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68013.221707.patch
Type: text/x-patch
Size: 7638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190925/11548916/attachment.bin>


More information about the llvm-commits mailing list