We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 526787f commit 04a811bCopy full SHA for 04a811b
mlir/lib/Conversion/MemRefToSPIRV/MemRefToSPIRV.cpp
@@ -22,6 +22,7 @@
22
#include "mlir/IR/MLIRContext.h"
23
#include "mlir/IR/Visitors.h"
24
#include <cassert>
25
+#include <limits>
26
#include <optional>
27
28
#define DEBUG_TYPE "memref-to-spirv-pattern"
@@ -467,6 +468,11 @@ struct MemoryRequirements {
467
468
static FailureOr<MemoryRequirements>
469
calculateMemoryRequirements(Value accessedPtr, bool isNontemporal,
470
uint64_t preferredAlignment) {
471
+
472
+ if (std::numeric_limits<uint32_t>::max() < preferredAlignment) {
473
+ return failure();
474
+ }
475
476
MLIRContext *ctx = accessedPtr.getContext();
477
478
auto memoryAccess = spirv::MemoryAccess::None;
0 commit comments