From 75950be836c9ad962a8aaf51ef664127d7b144b4 Mon Sep 17 00:00:00 2001 From: Ivan Kosarev Date: Thu, 21 Jul 2022 14:25:09 +0100 Subject: [PATCH] [AMDGPU][NFC] Validate G_MERGE_VALUES as we match zero-extended 32-bit scalars. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D130001 --- llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp b/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp index 18fadf0..f2e5c2f 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp @@ -3245,6 +3245,8 @@ static Register matchZeroExtendFromS32(MachineRegisterInfo &MRI, Register Reg) { if (Def->getOpcode() != AMDGPU::G_MERGE_VALUES) return Register(); + assert(Def->getNumOperands() == 3 && + MRI.getType(Def->getOperand(0).getReg()) == LLT::scalar(64)); if (mi_match(Def->getOperand(2).getReg(), MRI, m_ZeroInt())) { return Def->getOperand(1).getReg(); } -- 2.7.4