1. Dec 18, 2019
    • Alex Zinenko's avatar
      Homogenize the description of the MemRef conversion to the LLVM dialect · 651eaa03
      Alex Zinenko authored
      The conversion procedure has been updated to reflect the most recent MemRef
      descriptor proposal, but the documentation was only updated for the type
      conversion, omitting the address computation section. Make sure the two
      sections agree.
      
      PiperOrigin-RevId: 286022684
      651eaa03
    • Andy Davis's avatar
      Add pattern rewrite to forward vector tuple elements to their users. · d1fb285b
      Andy Davis authored
      User(TupleGetOp(ExtractSlicesOp(InsertSlicesOp(TupleOp(Producer))) -> User(Producer)
      
      PiperOrigin-RevId: 286020249
      d1fb285b
    • Jin Mingjian's avatar
      fix a typo in OpDefinitions doc · 9f45a224
      Jin Mingjian authored
      [{ matched with }], rather than ]}
      
      Closes tensorflow/mlir#320
      
      COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/320 from jinmingjian:patch-1 6b0870d02284f023bda2b28380960eb31d34f3b6
      PiperOrigin-RevId: 286007638
      9f45a224
    • River Riddle's avatar
      Add a new utility class TypeSwitch to ADT. · f44cf232
      River Riddle authored
      This class provides a simplified mechanism for defining a switch over a set of types using llvm casting functionality. More specifically, this allows for defining a switch over a value of type T where each case corresponds to a type(CaseT) that can be used with dyn_cast<CaseT>(...). An example is shown below:
      
      // Traditional piece of code:
      Operation *op = ...;
      if (auto constant = dyn_cast<ConstantOp>(op))
        ...;
      else if (auto return = dyn_cast<ReturnOp>(op))
        ...;
      else
        ...;
      
      // New piece of code:
      Operation *op = ...;
      TypeSwitch<Operation *>(op)
        .Case<ConstantOp>([](ConstantOp constant) { ... })
        .Case<ReturnOp>([](ReturnOp return) { ... })
        .Default([](Operation *op) { ... });
      
      Aside from the above, TypeSwitch supports return values, void return, multiple types per case, etc. The usability is intended to be very similar to StringSwitch.
      
      (Using c++14 template lambdas makes everything even nicer)
      More complex example of how this makes certain things easier:
      LogicalResult process(Constant op);
      LogicalResult process(ReturnOp op);
      LogicalResult process(FuncOp op);
      
      TypeSwitch<Operation *, LogicalResult>(op)
        .Case<ConstantOp, ReturnOp, FuncOp>([](auto op) { return process(op); })
        .Default([](Operation *op) { return op->emitError() << "could not be processed"; });
      
      PiperOrigin-RevId: 286003613
      f44cf232
    • MLIR Team's avatar
      Integrate from upstream at revision e4fce659. · 6e581e29
      MLIR Team authored
      PiperOrigin-RevId: 285982330
      6e581e29
  2. Dec 17, 2019
  3. Dec 16, 2019
    • Andy Davis's avatar
      Adds ExtractSlicesOp to the VectorOps dialect. · 73ec37c8
      Andy Davis authored
      ExtractSlicesOp extracts slices of its vector operand and with a specified tiling scheme.
      This operation centralizes the tiling scheme around a single op, which simplifies vector op unrolling and subsequent pattern rewrite transformations.
      
      PiperOrigin-RevId: 285761129
      73ec37c8
    • Alex Zinenko's avatar
      Make memref promotion during std->LLVM lowering the default calling convention · 0684aa9a
      Alex Zinenko authored
      During the conversion from the standard dialect to the LLVM dialect,
      memref-typed arguments are promoted from registers to memory and passed into
      functions by pointer. This had been introduced into the lowering to work around
      the abesnce of calling convention modeling in MLIR to enable better
      interoperability with LLVM IR generated from C, and has been exerciced for
      several months. Make this promotion the default calling covention when
      converting to the LLVM dialect. This adds the documentation, simplifies the
      code and makes the conversion consistent across function operations and
      function types used in other places, e.g. in high-order functions or
      attributes, which would not follow the same rule previously.
      
      PiperOrigin-RevId: 285751280
      0684aa9a
    • Tres Popp's avatar
      Remove LLVM dependency on mlir::Module and instead check Traits. · 44fc7d72
      Tres Popp authored
      PiperOrigin-RevId: 285724678
      44fc7d72
  4. Dec 15, 2019
  5. Dec 14, 2019
  6. Dec 13, 2019
  7. Dec 12, 2019
    • Nicolas Vasilache's avatar
      Move cpu runner utils templates to .h · 95b5a4fd
      Nicolas Vasilache authored
      This allows reusing the implementation in various places by just including and permits more easily writing test functions without explicit template instantiations.
      
      This also modifies UnrankedMemRefType to take a template type parameter since it cannot be type agnostic atm.
      
      PiperOrigin-RevId: 285187711
      95b5a4fd