-
Notifications
You must be signed in to change notification settings - Fork 247
Fix MergeBlock error: a merge block for another header #3280
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
base: main
Are you sure you want to change the base?
Conversation
| DominatorTree DomTree(*Fun); | ||
| LoopInfo LI(DomTree); | ||
| for (const auto *LoopObj : LI.getLoopsInPreorder()) { | ||
| // Find the innermost loop that contains the current basic block |
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.
| // Find the innermost loop that contains the current basic block | |
| // Find the innermost loop that contains the current basic block. |
| ; This test verifies that OpLoopMerge instructions properly assign unique merge blocks | ||
| ; and don't create conflicts where the same block is used as a merge block for multiple loops. | ||
|
|
||
| ; RUN: llvm-spirv %S/mergeBlock.bc -o %t.spv |
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.
Please, add the test contents in plain text in this file and call llvm-as from here.
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.
I think these binary file should be removed from the PR.
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.
and the same for the other .bc file.
|
|
||
| ; RUN: llvm-spirv --to-text %t.spv -o - | FileCheck %s --check-prefix=CHECK-SPIRV-TEXT | ||
| ; CHECK-SPIRV-TEXT: LoopMerge | ||
| ; CHECK-SPIRV-TEXT: BranchConditional No newline at end of file |
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.
Please, add newline at end of file.
|
|
||
| ; RUN: llvm-spirv --to-text %t.spv -o - | FileCheck %s --check-prefix=CHECK-SPIRV-TEXT | ||
| ; CHECK-SPIRV-TEXT: LoopMerge | ||
| ; CHECK-SPIRV-TEXT: BranchConditional No newline at end of file |
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.
should we add NEXT to verify that LoopMerge is immediately preceding?
| ; CHECK-SPIRV-TEXT: BranchConditional | |
| ; CHECK-SPIRV-TEXT-NEXT: BranchConditional |
|
|
||
| ; RUN: llvm-spirv --to-text %t.spv -o - | FileCheck %s --check-prefix=CHECK-SPIRV-TEXT | ||
| ; CHECK-SPIRV-TEXT: LoopMerge | ||
| ; CHECK-SPIRV-TEXT: BranchConditional No newline at end of file |
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.
Please, add newline at end of file.
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.
and the same for the other .bc file.
Code was assigning the same merge block to multiple headers. Added a fails as follows before the fix:
#3277 should be merged first as this test will trigger that error before hitting merge block error.