Rework run-mlir-iree failure logic to fail-safe.
Prior to this, a failing status during evaluation was triggering an AV
during cleanup. Also downgraded the big check fail at the end to a
failing return code.
--
58e7f9b3e53a466f50a0ab541d75b63bdf7fb54c by Stella Laurenzo <laurenzo@google.com>:
Rework flag parsing to allow semicolon.
Also materializes the split vector specifically, which was causing
issues on my compiler.
Closes #74
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/iree/pull/74 from stellaraccident:dev1 58e7f9b3e53a466f50a0ab541d75b63bdf7fb54c
PiperOrigin-RevId: 275101946
diff --git a/iree/tools/run_mlir_main.cc b/iree/tools/run_mlir_main.cc
index 200c7ac..3b7b3f9 100644
--- a/iree/tools/run_mlir_main.cc
+++ b/iree/tools/run_mlir_main.cc
@@ -157,8 +157,9 @@
std::string file_contents =
absl::StrReplaceAll(absl::GetFlag(FLAGS_input_values), {{"\\n", "\n"}});
std::vector<BufferView> inputs;
- for (const auto &line :
- absl::StrSplit(file_contents, '\n', absl::SkipWhitespace())) {
+ std::vector<std::string> lines = absl::StrSplit(
+ file_contents, absl::ByAnyChar("\n;"), absl::SkipWhitespace());
+ for (const auto &line : lines) {
ASSIGN_OR_RETURN(auto input,
hal::ParseBufferViewFromString(line, allocator));
inputs.push_back(input);