[PATCH] D135539: llvm-reduce: Don't write out IR to score IR complexity

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 11 13:19:13 PDT 2022


aeubanks added inline comments.


================
Comment at: llvm/tools/llvm-reduce/ReducerWorkItem.cpp:608
+    if (isa<UndefValue>(V) || isa<PoisonValue>(V))
+      return 0;
+    if (C->isNullValue())
----------------
arsenm wrote:
> aeubanks wrote:
> > aeubanks wrote:
> > > I thought we wanted undef to be more expensive than 0?
> > ping, maybe lump undef into `return 3`?
> Why would undef be treated as complex?
> 
> So far the actual scoring doesn't matter and we could probably do as well with a content  agnostic  hash that indicates some change occurred 
we'd rather reduce to 0 than undef

if we're going the route of hashing, then we should do that, but right now we're rerunning the reduction pipeline if the complexity has decreased. we try to reduce to 0 over undef, and if we do that but also make another reduction that decreases the complexity by one, the net complexity change will be zero and we won't rerun the pipeline.


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

https://reviews.llvm.org/D135539



More information about the llvm-commits mailing list