AMDGPU: Replace subtarget check with an assert
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 30 Jan 2020 02:40:18 +0000 (21:40 -0500)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 30 Jan 2020 22:15:26 +0000 (14:15 -0800)
This is already checked by the pattern subtarget predicate.

llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp

index ae9221d..d887ed6 100644 (file)
@@ -1852,8 +1852,7 @@ bool AMDGPUDAGToDAGISel::SelectSMRDImm(SDValue Addr, SDValue &SBase,
 bool AMDGPUDAGToDAGISel::SelectSMRDImm32(SDValue Addr, SDValue &SBase,
                                          SDValue &Offset) const {
 
-  if (Subtarget->getGeneration() != AMDGPUSubtarget::SEA_ISLANDS)
-    return false;
+  assert(Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS);
 
   bool Imm;
   if (!SelectSMRD(Addr, SBase, Offset, Imm))
@@ -1877,8 +1876,7 @@ bool AMDGPUDAGToDAGISel::SelectSMRDBufferImm(SDValue Addr,
 
 bool AMDGPUDAGToDAGISel::SelectSMRDBufferImm32(SDValue Addr,
                                                SDValue &Offset) const {
-  if (Subtarget->getGeneration() != AMDGPUSubtarget::SEA_ISLANDS)
-    return false;
+  assert(Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS);
 
   bool Imm;
   if (!SelectSMRDOffset(Addr, Offset, Imm))