[PATCH] D128317: stop llvm-reduce from introducing undefs

John Regehr via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 18:34:21 PDT 2022


regehr created this revision.
regehr added reviewers: fhahn, aeubanks.
Herald added subscribers: nlopes, mgorny.
Herald added a project: All.
regehr requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

this patch removes the operands-undef pass and also modifies several other passes that try to introduce undef to instead introduce a "default value" which at the moment is just the zero value.

it leaves an undef in ReduceRegisterUses.cpp, I leave fixing that as future work since I don't know much about MIR and don't to mess things up.

why do we want this patch? the major reason is because the client for reduced IR files is usually a human being, and we know that human beings are not that great about reasoning about undef. it's just really hard -- we'd often prefer a slightly bigger test case that doesn't contain undefs. the second reason is because undef is very difficult for alive2, and we're trying to develop an automated bugfinding workflow that relies on llvm-reduce, and getting gratuitous undefs is just a bad thing for that use case.


https://reviews.llvm.org/D128317

Files:
  llvm/test/tools/llvm-reduce/operands-to-args.ll
  llvm/test/tools/llvm-reduce/remove-all-of-multiple-args.ll
  llvm/test/tools/llvm-reduce/remove-args-used-by-ret.ll
  llvm/test/tools/llvm-reduce/remove-bbs-ret-nonvoid.ll
  llvm/test/tools/llvm-reduce/remove-bbs-unwinded-to.ll
  llvm/test/tools/llvm-reduce/remove-global-vars.ll
  llvm/test/tools/llvm-reduce/remove-operands-fp.ll
  llvm/test/tools/llvm-reduce/remove-operands.ll
  llvm/tools/llvm-reduce/CMakeLists.txt
  llvm/tools/llvm-reduce/DeltaManager.cpp
  llvm/tools/llvm-reduce/deltas/ReduceArguments.cpp
  llvm/tools/llvm-reduce/deltas/ReduceBasicBlocks.cpp
  llvm/tools/llvm-reduce/deltas/ReduceFunctions.cpp
  llvm/tools/llvm-reduce/deltas/ReduceGlobalVars.cpp
  llvm/tools/llvm-reduce/deltas/ReduceInstructions.cpp
  llvm/tools/llvm-reduce/deltas/ReduceOperands.cpp
  llvm/tools/llvm-reduce/deltas/ReduceOperands.h
  llvm/tools/llvm-reduce/deltas/ReduceOperandsSkip.cpp
  llvm/tools/llvm-reduce/deltas/ReduceOperandsToArgs.cpp
  llvm/tools/llvm-reduce/deltas/ReduceSpecialGlobals.cpp
  llvm/tools/llvm-reduce/deltas/Utils.cpp
  llvm/tools/llvm-reduce/deltas/Utils.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128317.438887.patch
Type: text/x-patch
Size: 19067 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220622/e7630264/attachment.bin>


More information about the llvm-commits mailing list