[PATCH] D136791: llvm-reduce: Support emitting bitcode for final result

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 13:57:24 PDT 2022


aeubanks accepted this revision.
aeubanks added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/test/tools/llvm-reduce/Inputs/test-output-format.ll:2
+
+define void @foo(ptr %ptr) {
+  store i32 0, ptr %ptr
----------------
can you use `llvm-as` instead of checking in the `.bc` file?


================
Comment at: llvm/tools/llvm-reduce/ReducerWorkItem.h:47
                      LLVMContext &Ctxt, std::unique_ptr<TargetMachine> &TM,
-                     bool IsMIR);
+                     bool IsMIR, bool &IsBitcode);
 
----------------
returning `std::pair<std::unique_ptr<ReducerWorkItem>, bool>` and using C++17 structured bindings seems nicer


================
Comment at: llvm/tools/llvm-reduce/llvm-reduce.cpp:161
+  bool OutputBitcode;
+  std::tie(OutputFilename, OutputBitcode) =
+      determineOutputType(ReduceModeMIR, InputIsBitcode);
----------------
does `auto [OutputFileName, OutputBitcode] = ` work?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136791/new/

https://reviews.llvm.org/D136791



More information about the llvm-commits mailing list