[ScopeNestedCFG] Prevent blocks containing convergent instructions from being cloned#8142
Open
bob80905 wants to merge 4 commits intomicrosoft:mainfrom
Open
[ScopeNestedCFG] Prevent blocks containing convergent instructions from being cloned#8142bob80905 wants to merge 4 commits intomicrosoft:mainfrom
bob80905 wants to merge 4 commits intomicrosoft:mainfrom
Conversation
Contributor
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
damyanp
reviewed
Feb 5, 2026
Comment on lines
17
to
27
|
|
||
| # Link against LLVMDXIL so that ScopeNestedCFG can use DxilUtil functions | ||
| target_link_libraries(DxilConvPasses | ||
| PRIVATE LLVMDXIL | ||
| ) | ||
|
|
||
| target_include_directories(DxilConvPasses | ||
| PRIVATE | ||
| ${DXC_SOURCE_DIR}/lib/DXIL | ||
| ${DXC_SOURCE_DIR}/lib/IR | ||
| ) |
Member
There was a problem hiding this comment.
Are any of these changes necessary?
I don't see any obvious new external functions being called, so I'm not sure why a lib is being added. I don't see any new headers being included, so I don't understand why we need to add two directories to the include path.
llvm-beanz
reviewed
Feb 5, 2026
| for (Instruction &I : *BB) { | ||
| if (auto *CI = dyn_cast<CallInst>(&I)) { | ||
| Function *CF = CI->getCalledFunction(); | ||
| if (CF && CF->hasFnAttribute(Attribute::AttrKind::Convergent)) |
Collaborator
There was a problem hiding this comment.
This probably doesn't actually fix the issue because we currently strip convergent attributes off DXIL operations before emitting the final DXIL so we would also need a pass to restore the convergent attribute.
I'm not sure what utilities DXC has for identifying convergent DXIL ops in absence of the attribute.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR modifies the ScopeNestedCFG pass to prevent blocks containing convergent instructions from being cloned.
Previously, blocks would be cloned by
TransformAcyclicRegionand similar functions. There should be an exception when blocks contain wave ops.Fixes #8141