//===- MatrixUtils.cpp - Utilities to lower matrix intrinsics ---*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // Utilities for generating tiled loops for matrix operations. // //===----------------------------------------------------------------------===// #include "llvm/Transforms/Utils/MatrixUtils.h" #include "llvm/Analysis/DomTreeUpdater.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Dominators.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/Type.h" usingnamespacellvm; BasicBlock *TileInfo::CreateLoop(BasicBlock *Preheader, BasicBlock *Exit, Value *Bound, Value *Step, StringRef Name, IRBuilderBase &B, DomTreeUpdater &DTU, Loop *L, LoopInfo &LI) { … } // Creates the following loop nest skeleton: // for C = 0; C < NumColumns; C += TileSize // for R = 0; R < NumRows; R += TileSize // for K = 0; K < Inner ; K += TileSize BasicBlock *TileInfo::CreateTiledLoops(BasicBlock *Start, BasicBlock *End, IRBuilderBase &B, DomTreeUpdater &DTU, LoopInfo &LI) { … }