Skip to content

Conversation

@rampitec
Copy link
Collaborator

The assert that RegScavenger required for long branching is now
placed below the code to use s_add_pc64, where it is actually
used.

The assert that RegScavenger required for long branching is now
placed below the code to use s_add_pc64, where it is actually
used.
Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@rampitec rampitec requested a review from shiltian August 18, 2025 19:29
@rampitec rampitec marked this pull request as ready for review August 18, 2025 19:30
@llvmbot
Copy link
Member

llvmbot commented Aug 18, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Stanislav Mekhanoshin (rampitec)

Changes

The assert that RegScavenger required for long branching is now
placed below the code to use s_add_pc64, where it is actually
used.


Full diff: https://github.com/llvm/llvm-project/pull/154187.diff

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/SIInstrInfo.cpp (-1)
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
index 41885e45b4101..5859c9def84db 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -2905,7 +2905,6 @@ void SIInstrInfo::insertIndirectBranch(MachineBasicBlock &MBB,
                                        MachineBasicBlock &RestoreBB,
                                        const DebugLoc &DL, int64_t BrOffset,
                                        RegScavenger *RS) const {
-  assert(RS && "RegScavenger required for long branching");
   assert(MBB.empty() &&
          "new block should be inserted for expanding unconditional branch");
   assert(MBB.pred_size() == 1);

@rampitec rampitec requested a review from changpeng August 18, 2025 20:44
MachineBasicBlock &RestoreBB,
const DebugLoc &DL, int64_t BrOffset,
RegScavenger *RS) const {
assert(RS && "RegScavenger required for long branching");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I.e., RS is unused by the code before its new location at line 2935.

@rampitec rampitec merged commit 906c9e9 into main Aug 18, 2025
13 checks passed
@rampitec rampitec deleted the users/rampitec/08-18-_amdgpu_remove_misplaced_assert branch August 18, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants