Skip to content

AMDGPU: Remove unnecessary lookup of function from machineinstr#208222

Merged
arsenm merged 1 commit into
mainfrom
users/arsenm/amdgpu/remove-shadowing-fold-operands-mf
Jul 8, 2026
Merged

AMDGPU: Remove unnecessary lookup of function from machineinstr#208222
arsenm merged 1 commit into
mainfrom
users/arsenm/amdgpu/remove-shadowing-fold-operands-mf

Conversation

@arsenm

@arsenm arsenm commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

The function is already a shadowed member of the class.

The function is already a shadowed member of the class.

arsenm commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

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

@arsenm arsenm marked this pull request as ready for review July 8, 2026 13:32
@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-backend-amdgpu

Author: Matt Arsenault (arsenm)

Changes

The function is already a shadowed member of the class.


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

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/SIFoldOperands.cpp (-2)
diff --git a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
index e13c2f4746190..ee20f138f245f 100644
--- a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
@@ -1376,7 +1376,6 @@ void SIFoldOperandsImpl::foldOperand(
       if (MovOp == AMDGPU::V_MOV_B16_t16_e64) {
         const auto &SrcOp = UseMI->getOperand(UseOpIdx);
         MachineOperand NewSrcOp(SrcOp);
-        MachineFunction *MF = UseMI->getMF();
         UseMI->removeOperand(1);
         UseMI->addOperand(*MF, MachineOperand::CreateImm(0)); // src0_modifiers
         UseMI->addOperand(NewSrcOp);                          // src0
@@ -1833,7 +1832,6 @@ bool SIFoldOperandsImpl::foldInstOperand(MachineInstr &MI,
   if (CopiesToReplace.empty() && FoldList.empty())
     return Changed;
 
-  MachineFunction *MF = MI.getMF();
   // Make sure we add EXEC uses to any new v_mov instructions created.
   for (MachineInstr *Copy : CopiesToReplace)
     Copy->addImplicitDefUseOperands(*MF);

@arsenm arsenm enabled auto-merge (squash) July 8, 2026 13:33
@arsenm arsenm merged commit 7b2e9db into main Jul 8, 2026
14 of 15 checks passed
@arsenm arsenm deleted the users/arsenm/amdgpu/remove-shadowing-fold-operands-mf branch July 8, 2026 14:11
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.

2 participants