[llvm] 4ab7c0d - [X86] X86TargetTransformInfo - remove unnecessary if-else after early exit. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 20 04:54:05 PDT 2021


Author: Simon Pilgrim
Date: 2021-09-20T12:53:17+01:00
New Revision: 4ab7c0d3fa068fb0ce39b9f75c0253d45a99745e

URL: https://github.com/llvm/llvm-project/commit/4ab7c0d3fa068fb0ce39b9f75c0253d45a99745e
DIFF: https://github.com/llvm/llvm-project/commit/4ab7c0d3fa068fb0ce39b9f75c0253d45a99745e.diff

LOG: [X86] X86TargetTransformInfo - remove unnecessary if-else after early exit. NFCI.

(style) Break the if-else chain as they all return.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86TargetTransformInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index 9feba110ce0a..e88b5e25b58b 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -259,11 +259,10 @@ InstructionCost X86TTIImpl::getArithmeticInstrCost(
       return getArithmeticInstrCost(Instruction::LShr, Ty, CostKind, Op1Info,
                                     Op2Info, TargetTransformInfo::OP_None,
                                     TargetTransformInfo::OP_None);
-
-    else // UREM
-      return getArithmeticInstrCost(Instruction::And, Ty, CostKind, Op1Info,
-                                    Op2Info, TargetTransformInfo::OP_None,
-                                    TargetTransformInfo::OP_None);
+    // UREM
+    return getArithmeticInstrCost(Instruction::And, Ty, CostKind, Op1Info,
+                                  Op2Info, TargetTransformInfo::OP_None,
+                                  TargetTransformInfo::OP_None);
   }
 
   static const CostTblEntry GLMCostTable[] = {
@@ -4814,7 +4813,7 @@ bool X86TTIImpl::isLegalNTStore(Type *DataType, Align Alignment) {
   // loads require AVX2).
   if (DataSize == 32)
     return ST->hasAVX();
-  else if (DataSize == 16)
+  if (DataSize == 16)
     return ST->hasSSE1();
   return true;
 }


        


More information about the llvm-commits mailing list