-
Notifications
You must be signed in to change notification settings - Fork 222
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
Can apply MemoryINTEL annotation multiple times on same variable #2230
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change itself looks ok, but we need tests to verify.
The main concern is that specification does not mention that we allow MemoryINTEL
decoration several times. Is it a planned change to the spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. Please address comments and change the title and the description - we actually don't apply MemoryINTEL
decoration twice or multiple times
; CHECK-SPV-IR: [[empty_annot:]] = private unnamed_addr constant [17 x i8] c"{memory:DEFAULT}\00", align 1 | ||
; CHECK-SPV-IR: [[mlab_annot:]] = private unnamed_addr constant [14 x i8] c"{memory:MLAB}\00", align 1 | ||
; CHECK-SPV-IR: [[block_ram_annot:]] = private unnamed_addr constant [19 x i8] c"{memory:BLOCK_RAM}\00", align 1 | ||
|
||
; CHECK-LLVM: [[empty_annot:]] = private unnamed_addr constant [17 x i8] c"{memory:DEFAULT}\00", align 1 | ||
; CHECK-LLVM: [[mlab_annot:]] = private unnamed_addr constant [14 x i8] c"{memory:MLAB}\00", align 1 | ||
; CHECK-LLVM: [[block_ram_annot:]] = private unnamed_addr constant [19 x i8] c"{memory:BLOCK_RAM}\00", align 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These checks are basically the same, I guess we can have only one tag (e.g., CHECK-LLVM
) and check it for both reverse runs. Same for the IR below
; CHECK-SPIRV: Decorate [[#empty:]] MemoryINTEL "DEFAULT" | ||
; CHECK-SPIRV: Decorate [[#mlab:]] MemoryINTEL "MLAB" | ||
; CHECK-SPIRV: Decorate [[#block_ram:]] MemoryINTEL "BLOCK_RAM" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I ask you to add checks that prove that we don't generate "DEFAULT"
more than once?
Co-authored-by: Dmitry Sidorov <dmitry.sidorov@intel.com>
According to SPIRV spec only one instance of a specific decoration can be on a SPIRV-Id, unless the decoration explicitly allows it.
LLVM IR has no such limitation.
MemoryINTEL
can have two annotations on the same pointer in LLVM IR. When it comes to translating this to SPIRV, we can filter out the less precise annotation (DEFAULT
) and only keep one that will be translated to a SPIRV decoration.