[PATCH] D99027: [InstCombine] Whitelist non-refining folds in SimplifyWithOpReplaced

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 21 06:01:48 PDT 2021


spatel added a comment.

LGTM - but see inline for general question/comment.



================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:3935-3936
+  if (!AllowRefinement) {
+    // General InstSimplify functions may refine the result. To avoid this,
+    // implement only a few non-refining but profitable transforms here.
+
----------------
I lost track of exactly what we mean by "refinement". The existing example in the code comment below + the test diffs in this patch suggest it is something like:
"Substitution with another value can't let poison flow where it did not before." ?
Are we getting in trouble with selects only or are there other opcodes with problems?

It can be independent of this patch, but we should make "refinement" clearer in the code comments here or in the header file comment where SimplifyWithOpReplaced() is declared.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99027



More information about the llvm-commits mailing list