[llvm] 1616a75 - X86: Use use_instructions in CompressEVEX cross-block check (#219408)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 28 01:28:38 PDT 2026
Author: Matt Arsenault
Date: 2026-08-28T08:28:30Z
New Revision: 1616a75cd51165f365dd8f403e4398169e31e34f
URL: https://github.com/llvm/llvm-project/commit/1616a75cd51165f365dd8f403e4398169e31e34f
DIFF: https://github.com/llvm/llvm-project/commit/1616a75cd51165f365dd8f403e4398169e31e34f.diff
LOG: X86: Use use_instructions in CompressEVEX cross-block check (#219408)
The loop only checks the using instruction's parent block, so iterate
use_instructions() instead of the operands and checking their parents.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
Added:
Modified:
llvm/lib/Target/X86/X86CompressEVEX.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86CompressEVEX.cpp b/llvm/lib/Target/X86/X86CompressEVEX.cpp
index be02c6375c0b5..2c408851975e8 100644
--- a/llvm/lib/Target/X86/X86CompressEVEX.cpp
+++ b/llvm/lib/Target/X86/X86CompressEVEX.cpp
@@ -372,8 +372,8 @@ static bool tryCompressVPMOVPattern(MachineInstr &MI, MachineBasicBlock &MBB,
return false;
// Check if MaskReg is used in any other basic blocks
- for (const MachineOperand &MO : MRI->use_operands(MaskReg))
- if (MO.getParent()->getParent() != &MBB)
+ for (const MachineInstr &UseMI : MRI->use_instructions(MaskReg))
+ if (UseMI.getParent() != &MBB)
return false;
// Apply the transformation
More information about the llvm-commits
mailing list