[llvm] 025cd30 - Collapse variable into assert to remove non-assert unused variable
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Tue May 5 11:05:23 PDT 2020
Author: David Blaikie
Date: 2020-05-05T11:04:43-07:00
New Revision: 025cd300cd0bbd68969ce899a178a680872a7039
URL: https://github.com/llvm/llvm-project/commit/025cd300cd0bbd68969ce899a178a680872a7039
DIFF: https://github.com/llvm/llvm-project/commit/025cd300cd0bbd68969ce899a178a680872a7039.diff
LOG: Collapse variable into assert to remove non-assert unused variable
Added:
Modified:
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
index b00dc72d73ce..1d0397afd771 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -2510,7 +2510,6 @@ bool SIInstrInfo::FoldImmediate(MachineInstr &UseMI, MachineInstr &DefMI,
unsigned Opc = UseMI.getOpcode();
if (Opc == AMDGPU::COPY) {
Register DstReg = UseMI.getOperand(0).getReg();
- Register SrcReg = UseMI.getOperand(1).getReg();
bool Is16Bit = getOpSize(UseMI, 0) == 2;
bool isVGPRCopy = RI.isVGPR(*MRI, DstReg);
unsigned NewOpc = isVGPRCopy ? AMDGPU::V_MOV_B32_e32 : AMDGPU::S_MOV_B32;
@@ -2538,7 +2537,7 @@ bool SIInstrInfo::FoldImmediate(MachineInstr &UseMI, MachineInstr &DefMI,
DstReg = RI.get32BitRegister(DstReg);
UseMI.getOperand(0).setReg(DstReg);
}
- assert(SrcReg.isVirtual());
+ assert(UseMI.getOperand(1).getReg().isVirtual());
}
UseMI.setDesc(get(NewOpc));
More information about the llvm-commits
mailing list