[llvm] [AMDGPU] Relax VOPD constraints for gfx12+ with data deps (PR #191264)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 11 21:33:22 PDT 2026


================
@@ -174,6 +180,57 @@ bool llvm::checkVOPDRegConstraints(const SIInstrInfo &TII,
   return true;
 }
 
+/// Core pair-eligibility check for a single VOPD encoding variant (VOPD or
+/// VOPD3).  Returns the X/Y assignment on success, or std::nullopt otherwise.
+static std::optional<VOPDMatchInfo>
+tryMatchVOPDPairVariant(const SIInstrInfo &TII, unsigned EncodingFamily,
+                        const MachineInstr &FirstMI,
+                        const MachineInstr &SecondMI, bool IsVOPD3) {
+  unsigned Opc = FirstMI.getOpcode();
+  unsigned Opc2 = SecondMI.getOpcode();
+  auto FirstCanBeVOPD = AMDGPU::getCanBeVOPD(Opc, EncodingFamily, IsVOPD3);
+  auto SecondCanBeVOPD = AMDGPU::getCanBeVOPD(Opc2, EncodingFamily, IsVOPD3);
+
----------------
shiltian wrote:

nit: no auto here

https://github.com/llvm/llvm-project/pull/191264


More information about the llvm-commits mailing list