[llvm] r248242 - AMDGPU: Remove unnecessary check

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 21:17:45 PDT 2015


Author: arsenm
Date: Mon Sep 21 23:17:45 2015
New Revision: 248242

URL: http://llvm.org/viewvc/llvm-project?rev=248242&view=rev
Log:
AMDGPU: Remove unnecessary check

If the instruction doesn't have enough operands, it
either shouldn't be marked as isCommutable or is malformed.

Modified:
    llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp

Modified: llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp?rev=248242&r1=248241&r2=248242&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp Mon Sep 21 23:17:45 2015
@@ -784,10 +784,6 @@ bool SIInstrInfo::expandPostRAPseudo(Mac
 
 MachineInstr *SIInstrInfo::commuteInstruction(MachineInstr *MI,
                                               bool NewMI) const {
-
-  if (MI->getNumOperands() < 3)
-    return nullptr;
-
   int CommutedOpcode = commuteOpcode(*MI);
   if (CommutedOpcode == -1)
     return nullptr;




More information about the llvm-commits mailing list