picceler
Loading...
Searching...
No Matches
image_access_helper.h
Go to the documentation of this file.
1#pragma once
2
3#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
4#include "mlir/IR/Builders.h"
5#include "mlir/IR/Location.h"
6#include "mlir/IR/Value.h"
7
8namespace picceler {
9
21 mlir::Value structPtr; // !llvm.ptr (Opaque pointer to the Image struct)
22 mlir::OpBuilder &builder;
23 mlir::Location loc;
24
25 ImageAccessHelper(mlir::Value ptr, mlir::OpBuilder &b, mlir::Location l);
26
34 static mlir::Type getImageStructType(mlir::MLIRContext *ctx);
35
42 mlir::Value getFieldAddr(int32_t index);
43
48 mlir::Value getWidth();
49
54 mlir::Value getHeight();
55
60 mlir::Value getDataPtr();
61};
62
63} // namespace picceler
Definition ast.h:11
mlir::Value getWidth()
Gets the value of the width field.
Definition image_access_helper.cpp:30
ImageAccessHelper(mlir::Value ptr, mlir::OpBuilder &b, mlir::Location l)
Definition image_access_helper.cpp:4
mlir::OpBuilder & builder
Definition image_access_helper.h:22
static mlir::Type getImageStructType(mlir::MLIRContext *ctx)
Defines the logical layout of the C++ struct for GEP offset calculations. struct Image { i32,...
Definition image_access_helper.cpp:7
mlir::Value structPtr
Definition image_access_helper.h:21
mlir::Value getDataPtr()
Gets the value of the data pointer field.
Definition image_access_helper.cpp:40
mlir::Value getHeight()
Gets the value of the height field.
Definition image_access_helper.cpp:35
mlir::Value getFieldAddr(int32_t index)
Internal helper to create the GEP (Address calculation) for a field index. The expected value of inde...
Definition image_access_helper.cpp:13
mlir::Location loc
Definition image_access_helper.h:23