Skip to content

Conversation

@arsenm
Copy link
Contributor

@arsenm arsenm commented Nov 21, 2024

Code inside assert changes the variable instead of the comparison.

Code inside assert changes the variable instead of the comparison.
Copy link
Contributor Author

arsenm commented Nov 21, 2024

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

@arsenm arsenm force-pushed the users/arsenm/gfx950/fix-mfma-source-check branch from c806c3c to 7565159 Compare November 21, 2024 21:00
@arsenm arsenm marked this pull request as ready for review November 21, 2024 21:00
@llvmbot
Copy link
Member

llvmbot commented Nov 21, 2024

@llvm/pr-subscribers-backend-amdgpu

Author: Matt Arsenault (arsenm)

Changes

Code inside assert changes the variable instead of the comparison.

Change-Id: I6054f152b551af80499f8a4597ac462f7bb0d383


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

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/SIISelLowering.cpp (+2-3)
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index 1406938592b2cb..e520dfff1016b2 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -15462,9 +15462,8 @@ void SITargetLowering::AdjustInstrPostInstrSelection(MachineInstr &MI,
         int Src0Idx = AMDGPU::getNamedOperandIdx(MI.getOpcode(),
                                                  AMDGPU::OpName::scale_src0);
         if (Src0Idx != -1) {
-          int Src1Idx = Src0Idx + 2;
-          assert(Src1Idx = AMDGPU::getNamedOperandIdx(
-                     MI.getOpcode(), AMDGPU::OpName::scale_src1));
+          int Src1Idx = AMDGPU::getNamedOperandIdx(MI.getOpcode(),
+                                                   AMDGPU::OpName::scale_src1);
           if (TII->usesConstantBus(MRI, MI, Src0Idx) &&
               TII->usesConstantBus(MRI, MI, Src1Idx))
             TII->legalizeOpWithMove(MI, Src1Idx);

@shiltian
Copy link
Contributor

Do we need ChangeId here?

@arsenm arsenm merged commit bd8a953 into main Nov 21, 2024
9 of 10 checks passed
@arsenm arsenm deleted the users/arsenm/gfx950/fix-mfma-source-check branch November 21, 2024 23:30
searlmc1 pushed a commit to ROCm/llvm-project that referenced this pull request Feb 17, 2025
Code inside assert changes the variable instead of the comparison.

Co-authored-by: Stanislav Mekhanoshin <[email protected]>

(cherry picked from commit bd8a953)
searlmc1 pushed a commit to ROCm/llvm-project that referenced this pull request Feb 17, 2025
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.

5 participants