[llvm] [Transform] Remove redundant condition (PR #107893)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 10:33:46 PDT 2024


================
@@ -770,8 +770,7 @@ static bool unswitchTrivialSwitch(Loop &L, SwitchInst &SI, DominatorTree &DT,
     // instruction in the block.
     auto *TI = BBToCheck.getTerminator();
     bool isUnreachable = isa<UnreachableInst>(TI);
-    return !isUnreachable ||
-           (isUnreachable && (BBToCheck.getFirstNonPHIOrDbg() != TI));
+    return !isUnreachable || (BBToCheck.getFirstNonPHIOrDbg() != TI);
----------------
fhahn wrote:

```suggestion
    return !isUnreachable || BBToCheck.getFirstNonPHIOrDbg() != TI;
```

https://github.com/llvm/llvm-project/pull/107893


More information about the llvm-commits mailing list