Skip to content

Commit b3eba80

Browse files
committed
Resolve test failure due to incorrect usage of getInt()
Resolve test failure by checking if an IntegerAttr is int
1 parent b8780fb commit b3eba80

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,8 @@ LLVMTypeConverter::getMemRefAddressSpace(BaseMemRefType type) const {
528528
if (!(*converted)) // Conversion to default is 0.
529529
return 0;
530530
if (auto explicitSpace = llvm::dyn_cast_if_present<IntegerAttr>(*converted)) {
531-
if (explicitSpace.getType().isSignedInteger())
531+
if (explicitSpace.getType().isIndex() ||
532+
explicitSpace.getType().isSignlessInteger())
532533
return explicitSpace.getInt();
533534
}
534535
return failure();

0 commit comments

Comments
 (0)