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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 10 06:56:20 PST 2022


fhahn 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));
----------------
nikic wrote:
> 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.
Removed. The only reason I made the constant folder an argument was that SROA was only using the regular ConstantFolder before. With TargetFolder being now used unconditionally, it also applies target-specific constant folding, but I  guess that should be fine.


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