[Mlir-commits] [mlir] [MLIR][LLVM] Improve atomic verifier to properly support larger types (PR #92120)
Tobias Gysi
llvmlistbot at llvm.org
Tue May 14 07:43:51 PDT 2024
================
@@ -839,34 +839,28 @@ void LoadOp::getEffects(
}
/// Returns true if the given type is supported by atomic operations. All
-/// integer and float types with limited bit width are supported. Additionally,
-/// depending on the operation pointers may be supported as well.
-static bool isTypeCompatibleWithAtomicOp(Type type, bool isPointerTypeAllowed) {
- if (llvm::isa<LLVMPointerType>(type))
- return isPointerTypeAllowed;
-
- std::optional<unsigned> bitWidth;
- if (auto floatType = llvm::dyn_cast<FloatType>(type)) {
- if (!isCompatibleFloatingPointType(type))
+/// integer, float, and pointer types with a power-of-two bitsize and a minimal
+/// size of 8 bits are supported.
+static bool isTypeCompatibleWithAtomicOp(Type type,
+ const DataLayout &dataLayout) {
+ if (!isa<IntegerType, LLVMPointerType>(type))
+ if (!isa<FloatType>(type) || !isCompatibleFloatingPointType(type))
----------------
gysit wrote:
```suggestion
if (!isCompatibleFloatingPointType(type))
```
nit: I believe this is not needed.
https://github.com/llvm/llvm-project/pull/92120
More information about the Mlir-commits
mailing list