[PATCH] D116935: [IRBuilder] Introduce folder using inst-simplify, use for Or fold.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 10 06:11:30 PST 2022


nikic added inline comments.


================
Comment at: llvm/include/llvm/Analysis/InstSimplifyFolder.h:54
+      if (auto *RC = dyn_cast_or_null<Constant>(RHS))
+        return ConstantFolder.FoldOr(LHS, RHS);
+    return SimplifyOrInst(LHS, RHS, SimplifyQuery(DL));
----------------
InstSimplify already delegates to target folding for constant operands. I think you should not explicitly handle this here, and InstSimplifyFolder shouldn't accept a ConstantFolder either. For the transitional phase you can hardcode use of TargetFolder.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116935



More information about the llvm-commits mailing list