- Mar 30, 2019
-
-
Uday Bondhugula authored
PiperOrigin-RevId: 206609084
-
Chris Lattner authored
- Generalize TwoOperands and TwoResults to NOperands and NResults, which can be used for any fixed N. - Rename OpImpl namespace to OpTrait, OpImpl::Base to OpBase, and TraitImpl to TraitBase to better reflect what these are. PiperOrigin-RevId: 206588634
-
Jacques Pienaar authored
PiperOrigin-RevId: 206587987
-
Uday Bondhugula authored
PiperOrigin-RevId: 206522239
-
Chris Lattner authored
and control edges. Wire the TensorFlow tests into the harness properly. Fix a bug in the CFGBuilder (not inserting at the insertion point) and flesh it out a bit more. PiperOrigin-RevId: 206511270
-
Chris Lattner authored
code. Change printing of affine map's to not print a space between the dim and symbol list. PiperOrigin-RevId: 206505419
-
Chris Lattner authored
- Sketch out a TensorFlow/IR directory that will hold op definitions and common TF support logic. We will eventually have TensorFlow/TF2HLO, TensorFlow/Grappler, TensorFlow/TFLite, etc. - Add sketches of a Switch/Merge op definition, including some missing stuff like the TwoResults trait. Add a skeleton of a pass to raise this form. - Beef up the Pass/FunctionPass definitions slightly, moving the common code out of LoopUnroll.cpp into a new IR/Pass.cpp file. - Switch ConvertToCFG.cpp to be a ModulePass. - Allow _ to start bare identifiers, since this is important for TF attributes. PiperOrigin-RevId: 206502517
-
Chris Lattner authored
VariadicOperands, tidy up some code in the asmprinter, fill out more verification logic in for LoadOp. PiperOrigin-RevId: 206443020
-
Chris Lattner authored
and OtherType. Other type is now the thing that holds AffineInt, Control, eventually Resource, Variant, String, etc. FloatType holds the floating point types, and allows convenient query of isa<FloatType>(). This fixes issues where we allowed control to be the element type of tensor, memref, vector. At the same time, ban AffineInt from being an element of a vector/memref/tensor as well since we don't need it. I updated the spec to match this as well. PiperOrigin-RevId: 206361942
-
Chris Lattner authored
out predecessor information in the asmprinter. PiperOrigin-RevId: 206343174
-
Jacques Pienaar authored
* Add tf_control as primitive type; * Allow $ in bare-id to allow attributes with $ (to make it trivially to mangle a TF attribute); PiperOrigin-RevId: 206342642
-
Uday Bondhugula authored
- Update InnermostLoopGatherer to use a post order traversal (linear time/single traversal). - Drop getNumNestedLoops(). - Update isInnermost() to use the StmtWalker. When using return values in conjunction with walkers, the StmtWalker CRTP pattern doesn't appear to be of any use. It just requires overriding nearly all of the methods, which is what InnermostLoopGatherer currently does. Please see FIXME/ENLIGHTENME comments. TODO: figure this out from this CL discussion. Note - Comments on visitor/walker base class are out of date; will update when this CL is finalized. PiperOrigin-RevId: 206340901
-
Tatiana Shpeisman authored
Implement MLValue, statement operands, operation statement operands and values. ML functions now have full support for expressing operations. Induction variables, function arguments and return values are still todo. PiperOrigin-RevId: 206253643
-
Chris Lattner authored
BasicBlockOperand to be more consistent with InstOperand. Rename getDestinations() to getBasicBlockOperands() to reduce confusion on their role. PiperOrigin-RevId: 206192327
-
Chris Lattner authored
into a more logical header. PiperOrigin-RevId: 206175435
-
MLIR Team authored
PiperOrigin-RevId: 206173887
-
MLIR Team authored
PiperOrigin-RevId: 206170570
-
Chris Lattner authored
Give BasicBlock a use/def list, making references to them in TerminatorInst's into a type that maintains the list. PiperOrigin-RevId: 206166388
-
Uday Bondhugula authored
The code for this has been convoluted. We shouldn't be doing a "*result = simplified" below at 703 since the simplified expression would have already been inserted by a simplify* method, whether it was a binary op expr or something else. PiperOrigin-RevId: 206114115
-
James Molloy authored
I tried to do the same with OperationInst; unfortunately that leads to some spicy ambiguities (should getOperand return CFGValue or SSAValue?) due to multiple inheritance from Operation which also has operand accessors. PiperOrigin-RevId: 206094072
-
James Molloy authored
The Instruction subclasses just need getInstOperands() and getNumOperands(). Operand iterators and the other accessors are provided by Instruction for free; why would we not just use those? PiperOrigin-RevId: 206075000
-
Chris Lattner authored
pointer, and ensure that functions are deleted when the module is destroyed. This exposed the fact that MLFunction had no dtor, and that the dtor in CFGFunction was broken with cyclic references. Fix both of these problems. PiperOrigin-RevId: 206051666
-
Chris Lattner authored
- Enhance memref type to allow omission of mappings and address spaces (implying a default mapping). - Fix printing of function types to properly recurse with printType so mappings are printed by name. - Simplify parsing of AffineMaps a bit now that we have isSymbolicOrConstant() PiperOrigin-RevId: 206039755
-
Chris Lattner authored
This regresses parser error recovery in some cases (in invalid.mlir) which I'll consider in a follow-up patch. The important thing in this patch is that the parse methods in StandardOps.cpp are nice and simple. PiperOrigin-RevId: 206023308
-
Uday Bondhugula authored
from the bump pointer allocator. - delete AffineExpr destructors. PiperOrigin-RevId: 205943807
-
Uday Bondhugula authored
- Implement a full loop unroll for innermost loops. - Use it to implement a pass that unroll all the innermost loops of all mlfunction's in a module. ForStmt's parsed currently have constant trip counts (and constant loop bounds). - Implement StmtVisitor based (Visitor pattern) Loop IVs aren't currently parsed and represented as SSA values. Replacing uses of loop IVs in unrolled bodies is thus a TODO. Class comments are sparse at some places - will add them after one round of comments. A cmd-line flag triggers this for now. Original: mlfunc @loops() { for x = 1 to 100 step 2 { for x = 1 to 4 { "Const"(){value: 1} : () -> () } } return } After unrolling: mlfunc @loops() { for x = 1 to 100 step 2 { "Const"(){value: 1} : () -> () "Const"(){value: 1} : () -> () "Const"(){value: 1} : () -> () "Const"(){value: 1} : () -> () } return } PiperOrigin-RevId: 205933235 -
MLIR Team authored
Uses these in AffineApplyOp verification (with tests). PiperOrigin-RevId: 205921877
-
James Molloy authored
PiperOrigin-RevId: 205920209
-
Chris Lattner authored
Non-leaf classes can only mark them protected, but that is better than nothing. PiperOrigin-RevId: 205919901
-
Chris Lattner authored
fixing the printing syntax for dim, constant, fadd, etc. PiperOrigin-RevId: 205908627
-
James Molloy authored
This looks heavyweight but most of the code is in the massive number of operand accessors! We need to be able to iterate over all operands to the condbr (all live-outs) but also just the true/just the false operands too. PiperOrigin-RevId: 205897704
-
James Molloy authored
Good: template<> void good(); Bad: template<> void bad(); Add .clang-format to enforce goodness. PiperOrigin-RevId: 205890909
-
Chris Lattner authored
testsuite a bit. PiperOrigin-RevId: 205852871
-
Tatiana Shpeisman authored
Scaffolding for convertToCFG pass that replaces all instances of ML functions with equivalent CFG functions. Traverses module MLIR, generates CFG functions (empty for now) and removes ML functions. Adds Transforms library and tests. PiperOrigin-RevId: 205848367
-
MLIR Team authored
Breaks "core operations" tests out into their own test file. PiperOrigin-RevId: 205848090
-
James Molloy authored
While fixing this the parser-affine-map.mlir test started failing due to ordering of the printed affine maps. Even the existing CHECK-DAGs weren't enough to disambiguate; a partial match on one line precluded a total match on a following line. The fix for this was easy - print the affine maps in reference order rather than in DenseMap iteration order. PiperOrigin-RevId: 205843770
-
Chris Lattner authored
- Op classes can now provide customized matchers, allowing specializations beyond just a name match. - We now provide default implementations of verify/print hooks, so Op classes only need to implement them if they're doing custom stuff, and only have to implement the ones they're interested in. - "Base" now takes a variadic list of template template arguments, allowing concrete Op types to avoid passing the Concrete type multiple times. - Add new ZeroOperands trait. - Add verification hooks to Zero/One/Two operands and OneResult to check that ops using them are correctly formed. - Implement getOperand hooks to zero/one/two operand traits, and getResult/getType hook to OneResult trait. - Add a new "constant" op to show some of this off, with a specialization for the constant case. This patch also splits op validity checks out to a new test/IR/invalid-ops.mlir file. This stubs out support for default asmprinter support. My next planned patch building on top of this will make asmprinter hooks real and will revise this. PiperOrigin-RevId: 205833214
-
Chris Lattner authored
consumeIf+emitError. NFC. PiperOrigin-RevId: 205753212
-
James Molloy authored
PiperOrigin-RevId: 205748638
-
Chris Lattner authored
list, for consistency with the rest of the language. Consolidate some parsing logic, add operand iterators to BranchInst. PiperOrigin-RevId: 205699457
-