[ScopBuilder] Simplify main statement flag in buildEqivClassBlockStmts. NFC.
commit3e98c51e09e4ba7b742f97ff62278cac4a6ff797
authorMichael Kruse <llvm@meinersbur.de>
Mon, 26 Aug 2019 21:31:47 +0000 (26 21:31 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Mon, 26 Aug 2019 21:31:47 +0000 (26 21:31 +0000)
treeb978277420a114b36eae08989efeac059e8d2950
parent89e2ebba39cf46ae0413c5f906df78f47080fe07
[ScopBuilder] Simplify main statement flag in buildEqivClassBlockStmts. NFC.

When reading code in ScopBuilder::buildEqivClassBlockStmts, I think the
main statement flag computation can be simplified, here is the patch.
It's based on two simple facts that:

  1. Instruction won't be removed once it's inserted into UnionFind.
  2. Main statement must be set if there is non-trivial statement besides the last one.

The patch also saves std::find call.

Patch by bin.narwal <bin.narwal@gmail.com>

Differential Revision: https://reviews.llvm.org/D66477

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@369972 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScopBuilder.cpp