[llvm] bdaf20b - PowerPC: Use use_instr_nodbg_begin in PPCReduceCRLogicals (#219988)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 31 08:43:55 PDT 2026


Author: Matt Arsenault
Date: 2026-08-31T17:43:50+02:00
New Revision: bdaf20beeda4e72b0701ce2fa950ab36fec7b6ad

URL: https://github.com/llvm/llvm-project/commit/bdaf20beeda4e72b0701ce2fa950ab36fec7b6ad
DIFF: https://github.com/llvm/llvm-project/commit/bdaf20beeda4e72b0701ce2fa950ab36fec7b6ad.diff

LOG: PowerPC: Use use_instr_nodbg_begin in PPCReduceCRLogicals (#219988)

Fetch the using instruction directly through the instruction iterator
instead of dereferencing an operand's parent.

Co-authored-by: Claude (Claude-Opus-4.8)

Added: 
    

Modified: 
    llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp b/llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp
index 83e3dbf2b2e56..233649296389c 100644
--- a/llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp
+++ b/llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp
@@ -655,7 +655,7 @@ bool PPCReduceCRLogicals::splitBlockOnBinaryCROp(CRLogicalOpInfo &CRI) {
 
   // Get the branch instruction.
   MachineInstr *Branch =
-    MRI->use_nodbg_begin(CRI.MI->getOperand(0).getReg())->getParent();
+      &*MRI->use_instr_nodbg_begin(CRI.MI->getOperand(0).getReg());
 
   // We want the new block to have no code in it other than the definition
   // of the input to the CR logical and the CR logical itself. So we move


        


More information about the llvm-commits mailing list