-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Fix crash when using when using --finalize-memref-to-llvm #112433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
b8780fb
b3eba80
709f0ce
419342b
46719a2
b039d7a
9904acb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -527,8 +527,11 @@ LLVMTypeConverter::getMemRefAddressSpace(BaseMemRefType type) const { | |
| return failure(); | ||
| if (!(*converted)) // Conversion to default is 0. | ||
| return 0; | ||
| if (auto explicitSpace = llvm::dyn_cast_if_present<IntegerAttr>(*converted)) | ||
| return explicitSpace.getInt(); | ||
| if (auto explicitSpace = llvm::dyn_cast_if_present<IntegerAttr>(*converted)) { | ||
siddhesh195 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (explicitSpace.getType().isIndex() || | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we instead change this to get the integer out of If not, this is reasonably approved
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the reviews. If the PR looks good, can someone help merge because I don't have write access
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll run CI and land this, thanks for helping! |
||
| explicitSpace.getType().isSignlessInteger()) | ||
| return explicitSpace.getInt(); | ||
| } | ||
| return failure(); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // RUN: mlir-opt %s -finalize-memref-to-llvm 2>&1 | FileCheck %s | ||
| // Since the error is at an unknown location, we use FileCheck instead of | ||
| // -veri-y-diagnostics here | ||
|
|
||
| // CHECK: conversion of memref memory space 1 : ui64 to integer address space failed. Consider adding memory space conversions. | ||
| // CHECK-LABEL: @invalid_int_conversion | ||
| func.func @invalid_int_conversion() { | ||
| %alloc_0 = memref.alloc() {alignment = 64 : i64} : memref<10xf32, 1 : ui64> | ||
| return | ||
siddhesh195 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.