[llvm] 3be955a - [NFC] Remove dead code

Luke Drummond via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 04:59:50 PDT 2024


Author: Luke Drummond
Date: 2024-08-26T12:59:41+01:00
New Revision: 3be955abbccaf1c9ca590834d5e5b27ab1f24b77

URL: https://github.com/llvm/llvm-project/commit/3be955abbccaf1c9ca590834d5e5b27ab1f24b77
DIFF: https://github.com/llvm/llvm-project/commit/3be955abbccaf1c9ca590834d5e5b27ab1f24b77.diff

LOG: [NFC] Remove dead code

There's an early exit branch a couple of lines earlier for `MVT ==
f64`. Convert to an assert rather than using the duplicate ternary here.
This silences an opinionated static analyser that's been bugging me.

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index cb3fbdb850c1ac..4cf7733a260ff0 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -745,8 +745,8 @@ GCNTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
   case Intrinsic::copysign:
     return NElts * getFullRateInstrCost();
   case Intrinsic::canonicalize: {
-    InstRate =
-        SLT == MVT::f64 ? get64BitInstrCost(CostKind) : getFullRateInstrCost();
+    assert(SLT != MVT::f64);
+    InstRate = getFullRateInstrCost();
     break;
   }
   case Intrinsic::uadd_sat:


        


More information about the llvm-commits mailing list