[Mlir-commits] [mlir] c26fcd1 - [MLIR] [Arith] [NFC] Remove switch statement default label due to warning

Stella Stamenova llvmlistbot at llvm.org
Tue Mar 1 15:25:27 PST 2022


Author: Max Kudryavtsev
Date: 2022-03-01T15:24:03-08:00
New Revision: c26fcd1ab8af34fb0841cd666525c5aad9888e3e

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

LOG: [MLIR] [Arith] [NFC] Remove switch statement default label due to warning

We are getting compiler warning because default label is excessive. Removing it for now.

[[ http://lab.llvm.org:8011/#/builders/61/builds/22782/steps/5/logs/warnings__2_ | view on buildbot ]]

```
/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp:1597:9: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default]
```

Related to: [[ https://reviews.llvm.org/D117257 | D117257 ]]

Reviewed By: stella.stamenova

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

Added: 
    

Modified: 
    mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp b/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp
index eea91dcde9724..c381247e4148a 100644
--- a/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp
+++ b/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp
@@ -1594,8 +1594,6 @@ class CmpFIntToFPConst final : public OpRewritePattern<CmpFOp> {
         // the compare predicate and sometimes the value.  rhsInt is rounded
         // towards zero at this point.
         switch (pred) {
-        default:
-          llvm_unreachable("Unexpected integer comparison!");
         case CmpIPredicate::ne: // (float)int != 4.4   --> true
           rewriter.replaceOpWithNewOp<ConstantIntOp>(op, /*value=*/true,
                                                      /*width=*/1);


        


More information about the Mlir-commits mailing list