[llvm] f4a6038 - [X86][NFC]Remove dead code in IfConversion.cpp

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 23:50:03 PDT 2023


Author: XinWang10
Date: 2023-08-07T23:49:33-07:00
New Revision: f4a6038e80655e9befe0b820e9a201de32696efa

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

LOG: [X86][NFC]Remove dead code in IfConversion.cpp

In line 544, if we go in to isFalse, then the Kind could be ICTriangleFalse and isRev must be False, so we never go into the true branch in line 545, better to remove it.

Reviewed By: skan, pengfei

Differential Revision: https://reviews.llvm.org/D157260

Added: 
    

Modified: 
    llvm/lib/CodeGen/IfConversion.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp
index 2ad5820bd9fbef..e8e276a8558d8a 100644
--- a/llvm/lib/CodeGen/IfConversion.cpp
+++ b/llvm/lib/CodeGen/IfConversion.cpp
@@ -541,13 +541,12 @@ bool IfConverter::runOnMachineFunction(MachineFunction &MF) {
         RetVal = IfConvertTriangle(BBI, Kind);
         LLVM_DEBUG(dbgs() << (RetVal ? "succeeded!" : "failed!") << "\n");
         if (RetVal) {
-          if (isFalse) {
-            if (isRev) ++NumTriangleFRev;
-            else       ++NumTriangleFalse;
-          } else {
-            if (isRev) ++NumTriangleRev;
-            else       ++NumTriangle;
-          }
+          if (isFalse)
+            ++NumTriangleFalse;
+          else if (isRev)
+            ++NumTriangleRev;
+          else
+            ++NumTriangle;
         }
         break;
       }


        


More information about the llvm-commits mailing list