Introduce [post]dominator tree and related infrastructure, use it in CFG func
authorChris Lattner <clattner@google.com>
Fri, 21 Sep 2018 21:40:36 +0000 (14:40 -0700)
committerjpienaar <jpienaar@google.com>
Fri, 29 Mar 2019 20:17:20 +0000 (13:17 -0700)
commitd6f8ec7bacb85e46abcfb19477afeaa9013a3b6f
treea579bef3e315cb9ceb875e039d864b90cadb1253
parent948dea045ba487249f596d81facbeeb59944a7ab
Introduce [post]dominator tree and related infrastructure, use it in CFG func
verifier.  We get most of this infrastructure directly from LLVM, we just
need to adapt it to our CFG abstraction.

This has a few unrelated changes engangled in it:
 - getFunction() in various classes was const incorrect, fix it.
 - This moves Verifier.cpp to the analysis library, since Verifier depends on
   dominance and these are both really analyses.
 - IndexedAccessorIterator::reference was defined wrong, leading to really
   exciting template errors that were fun to diagnose.
 - This flips the boolean sense of the foldOperation() function in constant
   folding pass in response to previous patch feedback.

PiperOrigin-RevId: 214046593
12 files changed:
mlir/include/mlir/Analysis/Dominance.h [new file with mode: 0644]
mlir/include/mlir/IR/BasicBlock.h
mlir/include/mlir/IR/CFGValue.h
mlir/include/mlir/IR/Operation.h
mlir/lib/Analysis/Dominance.cpp [new file with mode: 0644]
mlir/lib/Analysis/HyperRectangularSet.cpp
mlir/lib/Analysis/Verifier.cpp [new file with mode: 0644]
mlir/lib/IR/AsmPrinter.cpp
mlir/lib/IR/SSAValue.cpp
mlir/lib/IR/Verifier.cpp [deleted file]
mlir/lib/Transforms/ConstantFold.cpp
mlir/test/IR/invalid.mlir