File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
jaxlib/mosaic/dialect/tpu Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -371,4 +371,13 @@ SmallVector<Operation *> getNontrivialTransitiveUsers(Value v) {
371371 return users;
372372}
373373
374+ bool hasVectorOperandsOrResults (Operation& op) {
375+ for (Value value : llvm::concat<Value>(op.getOperands (), op.getResults ())) {
376+ if (isa<VectorType>(value.getType ())) {
377+ return true ;
378+ }
379+ }
380+ return false ;
381+ }
382+
374383} // namespace mlir::tpu
Original file line number Diff line number Diff line change @@ -299,6 +299,8 @@ std::optional<int64_t> getIntConst(Value v);
299299// results.
300300SmallVector<Operation *> getNontrivialTransitiveUsers (Value v);
301301
302+ bool hasVectorOperandsOrResults (Operation& op);
303+
302304// Return a mod b for a, b > 0, but adjusted to return b when a mod b == 0 such
303305// that the result is strictly positive.
304306template <typename U, typename V>
You can’t perform that action at this time.
0 commit comments