mirror of
https://github.com/ROCm/ROCm.git
synced 2026-04-05 03:01:17 -04:00
34 lines
1.1 KiB
C++
34 lines
1.1 KiB
C++
#ifndef TRITON_LIB_DIALECT_TRITONGPU_TRANSFORMS_UTILITY_H_
|
|
#define TRITON_LIB_DIALECT_TRITONGPU_TRANSFORMS_UTILITY_H_
|
|
#include "mlir/IR/Matchers.h"
|
|
#include "mlir/IR/PatternMatch.h"
|
|
#include "llvm/ADT/MapVector.h"
|
|
|
|
namespace mlir {
|
|
|
|
LogicalResult fixupLoops(ModuleOp mod);
|
|
|
|
// TODO: Interface
|
|
LogicalResult invertEncoding(Attribute targetEncoding, Operation *op,
|
|
Attribute &ret);
|
|
|
|
bool expensiveLoadOrStore(Operation *op, Attribute &targetEncoding);
|
|
|
|
bool expensiveToRemat(Operation *op, Attribute &targetEncoding);
|
|
|
|
int simulateBackwardRematerialization(
|
|
Operation *initOp, SetVector<Operation *> &processed,
|
|
SetVector<Attribute> &layout, llvm::MapVector<Value, Attribute> &toConvert,
|
|
Attribute targetEncoding);
|
|
|
|
Operation *cloneWithInferType(mlir::OpBuilder &rewriter, Operation *op,
|
|
IRMapping &mapping);
|
|
|
|
void rematerializeConversionChain(
|
|
const llvm::MapVector<Value, Attribute> &toConvert,
|
|
mlir::PatternRewriter &rewriter, SetVector<Operation *> &processed,
|
|
IRMapping &mapping);
|
|
} // namespace mlir
|
|
|
|
#endif // TRITON_LIB_DIALECT_TRITONGPU_TRANSFORMS_UTILITY_H_
|