[Mlir-commits] [mlir] [mlir][EmitC] Remove unreachable code and fix Windows build warning (PR #80677)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Feb 5 05:07:00 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-emitc
Author: Simon Camphausen (simon-camp)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/80677.diff
1 Files Affected:
- (modified) mlir/lib/Target/Cpp/TranslateToCpp.cpp (+7-2)
``````````diff
diff --git a/mlir/lib/Target/Cpp/TranslateToCpp.cpp b/mlir/lib/Target/Cpp/TranslateToCpp.cpp
index c0c6105409f8d8..194c79ff30cba2 100644
--- a/mlir/lib/Target/Cpp/TranslateToCpp.cpp
+++ b/mlir/lib/Target/Cpp/TranslateToCpp.cpp
@@ -86,13 +86,18 @@ static int getOperatorPrecedence(Operation *operation) {
case emitc::CmpPredicate::three_way:
return 10;
}
+ llvm_unreachable("Unsupported cmp predicate");
+ return 1;
})
.Case<emitc::DivOp>([&](auto op) { return 12; })
.Case<emitc::MulOp>([&](auto op) { return 12; })
.Case<emitc::RemOp>([&](auto op) { return 12; })
.Case<emitc::SubOp>([&](auto op) { return 11; })
- .Case<emitc::CallOpaqueOp>([&](auto op) { return 14; });
- llvm_unreachable("Unsupported operator");
+ .Case<emitc::CallOpaqueOp>([&](auto op) { return 14; })
+ .Default([](auto op) {
+ llvm_unreachable("Unsupported operator");
+ return 1;
+ });
}
namespace {
``````````
</details>
https://github.com/llvm/llvm-project/pull/80677
More information about the Mlir-commits
mailing list