summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Analysis/Verifier.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Standardize naming of statements -> instructions, revisting the code base to beChris Lattner2019-03-291-26/+27
| | | | | | | | | consistent and moving the using declarations over. Hopefully this is the last truly massive patch in this refactoring. This is step 21/n towards merging instructions and statements, NFC. PiperOrigin-RevId: 227178245
* Rename BasicBlock and StmtBlock to Block, and make a pass cleaning it up. I ↵Chris Lattner2019-03-291-8/+8
| | | | | | | | | | | did not make an effort to rename all of the 'bb' names in the codebase, since they are still correct and any specific missed once can be fixed up on demand. The last major renaming is Statement -> Instruction, which is why Statement and Stmt still appears in various places. This is step 19/n towards merging instructions and statements, NFC. PiperOrigin-RevId: 227163082
* Eliminate the using decls for MLFunction and CFGFunction standardizing onChris Lattner2019-03-291-8/+8
| | | | | | | | Function. This is step 18/n towards merging instructions and statements, NFC. PiperOrigin-RevId: 227139399
* Merge Operation into OperationInst and standardize nomenclature aroundChris Lattner2019-03-291-12/+12
| | | | | | | | OperationInst. This is a big mechanical patch. This is step 16/n towards merging instructions and statements, NFC. PiperOrigin-RevId: 227093712
* Merge SSAValue, CFGValue, and MLValue together into a single Value class, whichChris Lattner2019-03-291-1/+1
| | | | | | | | | is the new base of the SSA value hierarchy. This CL also standardizes all the nomenclature and comments to use 'Value' where appropriate. This also eliminates a large number of cast<MLValue>(x)'s, which is very soothing. This is step 11/n towards merging instructions and statements, NFC. PiperOrigin-RevId: 227064624
* Eliminate the Instruction, BasicBlock, CFGFunction, MLFunction, and ↵Chris Lattner2019-03-291-4/+8
| | | | | | | | | | | | ExtFunction classes, using the Statement/StmtBlock hierarchy and Function instead. This *only* changes the internal data structures, it does not affect the user visible syntax or structure of MLIR code. Function gets new "isCFG()" sorts of predicates as a transitional measure. This patch is gross in a number of ways, largely in an effort to reduce the amount of mechanical churn in one go. It introduces a bunch of using decls to keep the old names alive for now, and a bunch of stuff needs to be renamed. This is step 10/n towards merging instructions and statements, NFC. PiperOrigin-RevId: 227044402
* Refactor MLFunction to contain a StmtBlock for its body instead of inheritingChris Lattner2019-03-291-5/+5
| | | | | | | | | | from it. This is necessary progress to squaring away the parent relationship that a StmtBlock has with its enclosing if/for/fn, and makes room for functions to have more than one block in the future. This also removes IfClause and ForStmtBody. This is step 5/n towards merging instructions and statements, NFC. PiperOrigin-RevId: 226936541
* Refactor ForStmt: having it contain a StmtBlock instead of subclassingChris Lattner2019-03-291-3/+3
| | | | | | | | | | | | | | StmtBlock. This is more consistent with IfStmt and also conceptually makes more sense - a forstmt "isn't" its body, it contains its body. This is step 1/N towards merging BasicBlock and StmtBlock. This is required because in the new regime StmtBlock will have a use list (just like BasicBlock does) of operands, and ForStmt already has a use list for its induction variable. This is a mechanical patch, NFC. PiperOrigin-RevId: 226684158
* Return bool from all emitError methods similar to Operation::emitOpErrorSmit Hinsu2019-03-291-4/+2
| | | | | | | | | | | | | This simplifies call-sites returning true after emitting an error. After the conversion, dropped braces around single statement blocks as that seems more common. Also, switched to emitError method instead of emitting Error kind using the emitDiagnostic method. TESTED with existing unit tests PiperOrigin-RevId: 224527868
* [MLIR] Merge terminator and uses into BasicBlock operations list handling.River Riddle2019-03-291-17/+1
| | | | PiperOrigin-RevId: 221700132
* Replace TerminatorInst with builtin terminator operations.River Riddle2019-03-291-104/+5
| | | | | Note: Terminators will be merged into the operations list in a follow up patch. PiperOrigin-RevId: 221670037
* Implement value type abstraction for types.River Riddle2019-03-291-2/+2
| | | | | | This is done by changing Type to be a POD interface around an underlying pointer storage and adding in-class support for isa/dyn_cast/cast. PiperOrigin-RevId: 219372163
* Implement value type abstraction for attributes.River Riddle2019-03-291-8/+8
| | | | | | This is done by changing Attribute to be a POD interface around an underlying pointer storage and adding in-class support for isa/dyn_cast/cast. PiperOrigin-RevId: 218764173
* Move the ReturnOp type checks to ReturnOp::verify.Alex Zinenko2019-03-291-17/+0
| | | | | | | | | | | | | | | | This was left as a TODO in the code. Move the type verification from MLFuncVerifier::verifyReturn to ReturnOp::verify. Since the return operation can only appear as the last statement of an MLFunction, i.e. where the surrounding block is the function itself, it is easy to access the function descriptor (ReturnOp::verify already relies on this). From the function descriptor, one can easily access the type information. Note that this slightly modifies the error message due to the use of emitOpError instead of a plain emitError. Drop the obsolete TODO comment in MLFunction::verify about checking that "return" only appears as the last operation of an MLFunction since ReturnOp::verify explicitly checks for that. PiperOrigin-RevId: 218347843
* Verify that the first block of a cfgfunc does not have predecessors.Alex Zinenko2019-03-291-2/+6
| | | | | | | | | | | | | | This was left as a TODO in the code. Note that the spec does not explicitly prohibit the first basic block from having a predecessor, and may be worth updating. The error is reported at the location of the cfgfunc to which the basic block belongs since the location information of the block label is not propagated beyond the IR parser. Arguably, pointing to a function that starts with an ill-formed block is better than pointing to the first operation in that block as it makes easier to follow the code down until the first block label. PiperOrigin-RevId: 218343654
* Replace the "OperationSet" abstraction with a new Dialect abstraction. This isChris Lattner2019-03-291-6/+1
| | | | | | | | | a step forward because now every AbstractOperation knows which Dialect it is associated with, enabling things in the future like "constant folding hooks" which will be important for layering. This is also a bit nicer on the registration side of things. PiperOrigin-RevId: 218104230
* Introduce [post]dominator tree and related infrastructure, use it in CFG funcChris Lattner2019-03-291-0/+518
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
OpenPOWER on IntegriCloud