|
11 | 11 | //===----------------------------------------------------------------------===//
|
12 | 12 |
|
13 | 13 | #include "mlir/Dialect/Ptr/IR/PtrAttrs.h"
|
| 14 | +#include "mlir/IR/BuiltinTypes.h" |
14 | 15 | #include "llvm/ADT/TypeSwitch.h"
|
15 | 16 |
|
16 | 17 | using namespace mlir;
|
17 | 18 | using namespace mlir::ptr;
|
18 | 19 |
|
19 | 20 | constexpr const static unsigned kBitsInByte = 8;
|
20 | 21 |
|
| 22 | +//===----------------------------------------------------------------------===// |
| 23 | +// IAddressSpaceAttr |
| 24 | +//===----------------------------------------------------------------------===// |
| 25 | + |
| 26 | +LogicalResult IAddressSpaceAttr::isValidLoad( |
| 27 | + Type type, ptr::AtomicOrdering ordering, IntegerAttr alignment, |
| 28 | + function_ref<InFlightDiagnostic()> emitError) const { |
| 29 | + return success(); |
| 30 | +} |
| 31 | + |
| 32 | +LogicalResult IAddressSpaceAttr::isValidStore( |
| 33 | + Type type, ptr::AtomicOrdering ordering, IntegerAttr alignment, |
| 34 | + function_ref<InFlightDiagnostic()> emitError) const { |
| 35 | + return success(); |
| 36 | +} |
| 37 | + |
| 38 | +LogicalResult IAddressSpaceAttr::isValidAtomicOp( |
| 39 | + ptr::AtomicBinOp op, Type type, ptr::AtomicOrdering ordering, |
| 40 | + IntegerAttr alignment, function_ref<InFlightDiagnostic()> emitError) const { |
| 41 | + return success(); |
| 42 | +} |
| 43 | + |
| 44 | +LogicalResult IAddressSpaceAttr::isValidAtomicXchg( |
| 45 | + Type type, ptr::AtomicOrdering successOrdering, |
| 46 | + ptr::AtomicOrdering failureOrdering, IntegerAttr alignment, |
| 47 | + function_ref<InFlightDiagnostic()> emitError) const { |
| 48 | + return success(); |
| 49 | +} |
| 50 | + |
| 51 | +LogicalResult IAddressSpaceAttr::isValidAddrSpaceCast( |
| 52 | + Type tgt, Type src, function_ref<InFlightDiagnostic()> emitError) const { |
| 53 | + // TODO: update this method once the `addrspace_cast` op is added to the |
| 54 | + // dialect. |
| 55 | + assert(false && "unimplemented, see TODO in the source."); |
| 56 | + return failure(); |
| 57 | +} |
| 58 | + |
| 59 | +LogicalResult IAddressSpaceAttr::isValidPtrIntCast( |
| 60 | + Type intLikeTy, Type ptrLikeTy, |
| 61 | + function_ref<InFlightDiagnostic()> emitError) const { |
| 62 | + // TODO: update this method once the int-cast ops are added to the dialect. |
| 63 | + assert(false && "unimplemented, see TODO in the source."); |
| 64 | + return failure(); |
| 65 | +} |
| 66 | + |
21 | 67 | //===----------------------------------------------------------------------===//
|
22 | 68 | // SpecAttr
|
23 | 69 | //===----------------------------------------------------------------------===//
|
|
0 commit comments